Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Python 3.12 #113

Merged
merged 1 commit into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: macos-latest
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
Expand Down Expand Up @@ -50,17 +50,17 @@ jobs:
pip install cramjam --no-index --find-links dist --force-reinstall
pip install cramjam-cli --no-index --find-links dist --force-reinstall
- name: Build wheels - universal2
if: ${{ matrix.python-version >= '3.8' || contains(fromJson('["3.10", "3.11"]'), matrix.python-version) }}
if: ${{ matrix.python-version >= '3.8' || contains(fromJson('["3.10", "3.11", "3.12"]'), matrix.python-version) }}
uses: PyO3/maturin-action@v1
with:
args: -i python --release --target universal2-apple-darwin --out dist --manifest-path cramjam-cli/Cargo.toml
- name: Build wheels - universal2
if: ${{ matrix.python-version >= '3.8' || contains(fromJson('["3.10", "3.11"]'), matrix.python-version) }}
if: ${{ matrix.python-version >= '3.8' || contains(fromJson('["3.10", "3.11", "3.12"]'), matrix.python-version) }}
uses: PyO3/maturin-action@v1
with:
args: -i python --release --target universal2-apple-darwin --out dist --manifest-path cramjam-python/Cargo.toml
- name: Install built wheels - universal2
if: ${{ matrix.python-version >= '3.8' || contains(fromJson('["3.10", "3.11"]'), matrix.python-version) }}
if: ${{ matrix.python-version >= '3.8' || contains(fromJson('["3.10", "3.11", "3.12"]'), matrix.python-version) }}
run: |
pip install cramjam --no-index --find-links dist --force-reinstall
pip install cramjam-cli --no-index --find-links dist --force-reinstall
Expand All @@ -81,7 +81,7 @@ jobs:
runs-on: windows-latest
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
target: [x64, x86]
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -137,7 +137,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
target: [x86_64, i686]
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -200,6 +200,7 @@ jobs:
- '3.9'
- '3.10'
- '3.11'
- '3.12'
target: [aarch64, armv7, s390x, ppc64le]
include:
- python: pypy3.7
Expand Down Expand Up @@ -247,7 +248,7 @@ jobs:
apt-get install -y --no-install-recommends python3 python3-venv software-properties-common
add-apt-repository ppa:deadsnakes/ppa
apt-get update
apt-get install -y curl python3.7-venv python3.9-venv python3.10-venv python3.11-venv
apt-get install -y curl python3.7-venv python3.9-venv python3.10-venv python3.11-venv python3.12-venv
run: |
ls -lrth /artifacts
PYTHON=python${{ matrix.python }}
Expand Down
57 changes: 21 additions & 36 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion cramjam-python/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ extension-module = ["pyo3/extension-module"]


[dependencies]
pyo3 = { version = "^0.18", default-features = false, features = ["macros"] }
# Python 3.12 support not officially released yet
pyo3 = { git = "https://github.com/PyO3/pyo3.git", rev="90cc69b", default-features = false, features = ["macros"] }
libcramjam = { path = "../libcramjam" }
2 changes: 1 addition & 1 deletion cramjam-python/src/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ use std::os::raw::c_int;
use crate::exceptions::CompressionError;
use crate::BytesType;
use pyo3::exceptions::{self, PyBufferError};
use pyo3::ffi;
use pyo3::prelude::*;
use pyo3::types::PyBytes;
use pyo3::{ffi, AsPyPointer};
use std::path::PathBuf;

pub(crate) trait AsBytes {
Expand Down