From 1694c72defa96fc6309c8b54608bb4f915cf8afd Mon Sep 17 00:00:00 2001 From: Anghelo Carvajal Date: Sat, 11 Oct 2025 14:36:25 -0300 Subject: [PATCH 01/18] Add `no_std` support --- .github/workflows/rust.yml | 14 ++++++++++++++ CHANGELOG.md | 4 ++++ Cargo.lock | 8 ++++---- lib/Cargo.toml | 9 +++++++-- lib/src/gzip.rs | 18 +++++++++++------- lib/src/lib.rs | 5 +++++ lib/src/mio0.rs | 3 +++ lib/src/utils.rs | 2 +- lib/src/yay0.rs | 3 +++ lib/src/yaz0.rs | 3 +++ 10 files changed, 55 insertions(+), 14 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 881ab9b..fdbd987 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -62,3 +62,17 @@ jobs: # To find current MSRV use `cargo msrv find`. Install it with `cargo install cargo-msrv --locked` - name: Run MSRV checker run: cargo hack check --rust-version --workspace --all-targets --ignore-private + + msrv_no_default: + name: Check MSRV + runs-on: ubuntu-latest + steps: + - name: Checkout reposistory + uses: actions/checkout@v5 + + - name: Setup MSRV checker + uses: taiki-e/install-action@cargo-hack + + # To find current MSRV use `cargo msrv find`. Install it with `cargo install cargo-msrv --locked` + - name: Run MSRV checker + run: cargo hack check --rust-version --workspace --all-targets --ignore-private --no-default-features diff --git a/CHANGELOG.md b/CHANGELOG.md index 684d57f..dc08f0b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added + +- `no_std` support. + ## [0.5.4] - 2024-12-15 ### Fixed diff --git a/Cargo.lock b/Cargo.lock index 450a9e2..2ebb36a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -507,18 +507,18 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] name = "thiserror" -version = "1.0.69" +version = "2.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +checksum = "f63587ca0f12b72a0600bcba1d40081f830876000bb46dd2337a3051618f4fc8" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.69" +version = "2.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +checksum = "3ff15c8ecd7de3849db632e14d18d2571fa09dfc5ed93479bc4485c7a517c913" dependencies = [ "proc-macro2", "quote", diff --git a/lib/Cargo.toml b/lib/Cargo.toml index 3895fd7..05a4d7d 100644 --- a/lib/Cargo.toml +++ b/lib/Cargo.toml @@ -7,6 +7,7 @@ description = "A library for handling common compression formats for N64 games" repository = "https://github.com/decompals/crunch64" license = "MIT" rust-version = "1.74.0" +categories = ["no-std"] [lib] name = "crunch64" @@ -16,11 +17,15 @@ crate-type = ["lib", "staticlib", "cdylib"] [dependencies] crc32fast = "1.4.2" pyo3 = { version="0.23.5", features = ["extension-module"], optional = true } -thiserror = "1.0" +thiserror = { version="2", default-features = false } [dev-dependencies] rstest = "0.18.2" [features] +default = [] + +std = ["thiserror/std"] + c_bindings = [] -python_bindings = ["dep:pyo3"] +python_bindings = ["dep:pyo3", "std"] diff --git a/lib/src/gzip.rs b/lib/src/gzip.rs index f106aa7..2287dd2 100644 --- a/lib/src/gzip.rs +++ b/lib/src/gzip.rs @@ -5,6 +5,9 @@ // original gzip code and https://datatracker.ietf.org/doc/html/rfc1951 for // details on the DEFLATE compression format. +use alloc::{boxed::Box, vec::Vec}; +use core::cmp; + use crate::{utils, Crunch64Error}; // Bitstream writer for compressed output @@ -146,13 +149,13 @@ struct Tree { } impl Ord for Tree { - fn cmp(&self, other: &Self) -> std::cmp::Ordering { + fn cmp(&self, other: &Self) -> cmp::Ordering { (self.freq, self.depth).cmp(&(other.freq, other.depth)) } } impl PartialOrd for Tree { - fn partial_cmp(&self, other: &Self) -> Option { + fn partial_cmp(&self, other: &Self) -> Option { Some(self.cmp(other)) } } @@ -253,7 +256,7 @@ impl HuffmanCode { let new_tree = Tree { root: new_node, freq: node1.freq + node2.freq, - depth: 1 + std::cmp::max(node1.depth, node2.depth), + depth: 1 + cmp::max(node1.depth, node2.depth), }; heap.replace_min(new_tree); } @@ -731,7 +734,7 @@ impl BlockWriter { } else { usize::MAX }; - let compressed_size_bytes = std::cmp::min(fixed_size_bytes, dynamic_size_bytes); + let compressed_size_bytes = cmp::min(fixed_size_bytes, dynamic_size_bytes); // Write block output.write_bits(eof as u16, 1); @@ -916,7 +919,7 @@ pub fn compress(bytes: &[u8], level: usize, small_mem: bool) -> Result .copy_from_slice(ORIGINAL_GZIP_GARBAGE); // Position in input buffer - let mut input_pos = std::cmp::min(2 * WINDOW_SIZE, input_size); + let mut input_pos = cmp::min(2 * WINDOW_SIZE, input_size); // True if we have reached the end of input let mut eof: bool = input_size < 2 * WINDOW_SIZE; // Length of current block @@ -999,7 +1002,7 @@ pub fn compress(bytes: &[u8], level: usize, small_mem: bool) -> Result } } - best_len = std::cmp::min(best_len, lookahead); + best_len = cmp::min(best_len, lookahead); if best_len == MIN_MATCH && pos - best_pos > TOO_FAR { best_len = MIN_MATCH - 1; } @@ -1080,7 +1083,7 @@ pub fn compress(bytes: &[u8], level: usize, small_mem: bool) -> Result } let refill_start = input_pos; - let refill_end = std::cmp::min(refill_start + WINDOW_SIZE, input_size); + let refill_end = cmp::min(refill_start + WINDOW_SIZE, input_size); let refill_size = refill_end - refill_start; window[WINDOW_SIZE..WINDOW_SIZE + refill_size] .copy_from_slice(&bytes[refill_start..refill_end]); @@ -1189,6 +1192,7 @@ pub(crate) mod python_bindings { } #[cfg(test)] +#[cfg(feature = "std")] mod tests { use crate::Crunch64Error; use core::panic; diff --git a/lib/src/lib.rs b/lib/src/lib.rs index 3f5036f..bb38bd1 100644 --- a/lib/src/lib.rs +++ b/lib/src/lib.rs @@ -1,3 +1,8 @@ +#![cfg_attr(not(feature = "std"), no_std)] + +#[macro_use] +extern crate alloc; + pub mod gzip; pub mod mio0; pub mod yay0; diff --git a/lib/src/mio0.rs b/lib/src/mio0.rs index 21cd380..0561b89 100644 --- a/lib/src/mio0.rs +++ b/lib/src/mio0.rs @@ -1,3 +1,5 @@ +use alloc::{boxed::Box, vec::Vec}; + use crate::{utils, Crunch64Error}; fn parse_header(bytes: &[u8]) -> Result<(usize, usize, usize), Crunch64Error> { @@ -304,6 +306,7 @@ pub(crate) mod python_bindings { } #[cfg(test)] +#[cfg(feature = "std")] mod tests { use crate::Crunch64Error; use core::panic; diff --git a/lib/src/utils.rs b/lib/src/utils.rs index c59d241..529b927 100644 --- a/lib/src/utils.rs +++ b/lib/src/utils.rs @@ -1,4 +1,4 @@ -use std::cmp; +use core::cmp; use crate::Crunch64Error; diff --git a/lib/src/yay0.rs b/lib/src/yay0.rs index c27544a..379b4d9 100644 --- a/lib/src/yay0.rs +++ b/lib/src/yay0.rs @@ -1,3 +1,5 @@ +use alloc::{boxed::Box, vec::Vec}; + use crate::{utils, Crunch64Error}; fn parse_header(bytes: &[u8]) -> Result<(usize, usize, usize), Crunch64Error> { @@ -317,6 +319,7 @@ pub(crate) mod python_bindings { } #[cfg(test)] +#[cfg(feature = "std")] mod tests { use crate::Crunch64Error; use core::panic; diff --git a/lib/src/yaz0.rs b/lib/src/yaz0.rs index 9ec6fce..59bb098 100644 --- a/lib/src/yaz0.rs +++ b/lib/src/yaz0.rs @@ -1,5 +1,7 @@ // Based on https://gist.github.com/Mr-Wiseguy/6cca110d74b32b5bb19b76cfa2d7ab4f +use alloc::{boxed::Box, vec::Vec}; + use crate::{utils, Crunch64Error}; fn parse_header(bytes: &[u8]) -> Result { @@ -305,6 +307,7 @@ pub(crate) mod python_bindings { } #[cfg(test)] +#[cfg(feature = "std")] mod tests { use crate::Crunch64Error; use core::panic; From aed38508fc04b5c4c8fe074c990f39ee742aa900 Mon Sep 17 00:00:00 2001 From: Anghelo Carvajal Date: Sat, 11 Oct 2025 14:49:19 -0300 Subject: [PATCH 02/18] Update maturin workflow --- .github/workflows/maturin_upload_pypi.yml | 161 +++++++++++++--------- 1 file changed, 95 insertions(+), 66 deletions(-) diff --git a/.github/workflows/maturin_upload_pypi.yml b/.github/workflows/maturin_upload_pypi.yml index 934c2ee..fc03138 100644 --- a/.github/workflows/maturin_upload_pypi.yml +++ b/.github/workflows/maturin_upload_pypi.yml @@ -1,4 +1,4 @@ -# This file is autogenerated by maturin v1.2.3 +# This file is autogenerated by maturin v1.9.6 # To update, run # # maturin generate-ci github @@ -15,111 +15,138 @@ permissions: jobs: linux: - runs-on: ubuntu-latest + runs-on: ${{ matrix.platform.runner }} strategy: matrix: - target: [x86_64, x86, aarch64, armv7, s390x, ppc64le] - fail-fast: false + platform: + - runner: ubuntu-22.04 + target: x86_64 + - runner: ubuntu-22.04 + target: x86 + - runner: ubuntu-22.04 + target: aarch64 + - runner: ubuntu-22.04 + target: armv7 + - runner: ubuntu-22.04 + target: s390x + - runner: ubuntu-22.04 + target: ppc64le steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@main - uses: actions/setup-python@v5 with: - python-version: '3.9 - 3.13' + python-version: 3.x - name: Build wheels uses: PyO3/maturin-action@v1 - env: - PYO3_USE_ABI3_FORWARD_COMPATIBILITY: 1 with: - target: ${{ matrix.target }} - args: --release --out ../dist --find-interpreter - sccache: 'true' + target: ${{ matrix.platform.target }} + args: --release --out dist --find-interpreter + sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} manylinux: auto - working-directory: lib/ - name: Upload wheels uses: actions/upload-artifact@v4 with: - name: wheels-linux-${{ matrix.target }} + name: wheels-linux-${{ matrix.platform.target }} + path: dist + + musllinux: + runs-on: ${{ matrix.platform.runner }} + strategy: + matrix: + platform: + - runner: ubuntu-22.04 + target: x86_64 + - runner: ubuntu-22.04 + target: x86 + - runner: ubuntu-22.04 + target: aarch64 + - runner: ubuntu-22.04 + target: armv7 + steps: + - uses: actions/checkout@main + - uses: actions/setup-python@v5 + with: + python-version: 3.x + - name: Build wheels + uses: PyO3/maturin-action@v1 + with: + target: ${{ matrix.platform.target }} + args: --release --out dist --find-interpreter + sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} + manylinux: musllinux_1_2 + - name: Upload wheels + uses: actions/upload-artifact@v4 + with: + name: wheels-musllinux-${{ matrix.platform.target }} path: dist - if-no-files-found: error windows: - runs-on: windows-latest + runs-on: ${{ matrix.platform.runner }} strategy: matrix: - target: [x64, x86] - fail-fast: false + platform: + - runner: windows-latest + target: x64 + - runner: windows-latest + target: x86 steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@main - uses: actions/setup-python@v5 with: - python-version: '3.13' - architecture: ${{ matrix.target }} + python-version: 3.x + architecture: ${{ matrix.platform.target }} - name: Build wheels uses: PyO3/maturin-action@v1 - env: - PYO3_USE_ABI3_FORWARD_COMPATIBILITY: 1 with: - target: ${{ matrix.target }} - args: --release --out ../dist --find-interpreter - sccache: 'true' - working-directory: lib/ + target: ${{ matrix.platform.target }} + args: --release --out dist --find-interpreter + sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} - name: Upload wheels uses: actions/upload-artifact@v4 with: - name: wheels-windows-${{ matrix.target }} + name: wheels-windows-${{ matrix.platform.target }} path: dist - if-no-files-found: error macos: - runs-on: macos-latest + runs-on: ${{ matrix.platform.runner }} strategy: matrix: - target: [x86_64, aarch64] - fail-fast: false + platform: + - runner: macos-13 + target: x86_64 + - runner: macos-14 + target: aarch64 steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@main - uses: actions/setup-python@v5 with: - python-version: '3.13' + python-version: 3.x - name: Build wheels uses: PyO3/maturin-action@v1 - env: - PYO3_USE_ABI3_FORWARD_COMPATIBILITY: 1 with: - target: ${{ matrix.target }} - args: --release --out ../dist --find-interpreter - sccache: 'true' - working-directory: lib/ + target: ${{ matrix.platform.target }} + args: --release --out dist --find-interpreter + sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} - name: Upload wheels uses: actions/upload-artifact@v4 with: - name: wheels-macos-${{ matrix.target }} + name: wheels-macos-${{ matrix.platform.target }} path: dist - if-no-files-found: error sdist: runs-on: ubuntu-latest - strategy: - fail-fast: false steps: - - name: Checkout repo - uses: actions/checkout@v5 - + - uses: actions/checkout@main - name: Build sdist uses: PyO3/maturin-action@v1 - env: - PYO3_USE_ABI3_FORWARD_COMPATIBILITY: 1 with: command: sdist - args: --out ../dist - working-directory: lib/ - + args: --out dist - name: Upload sdist uses: actions/upload-artifact@v4 with: - name: sdist + name: wheels-sdist path: dist - if-no-files-found: error check_clippy_python_bindings: name: Check clippy for Python bindings @@ -127,7 +154,7 @@ jobs: steps: - name: Checkout reposistory - uses: actions/checkout@v5 + uses: actions/checkout@main - name: Setup Rust toolchain uses: dtolnay/rust-toolchain@stable @@ -143,24 +170,26 @@ jobs: release: name: Release runs-on: ubuntu-latest - if: startsWith(github.ref, 'refs/tags/') - needs: [linux, windows, macos, sdist] - strategy: - fail-fast: false + if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }} + needs: [linux, musllinux, windows, macos, sdist, check_clippy_python_bindings] + permissions: + # Use to sign the release artifacts + id-token: write + # Used to upload release artifacts + contents: write + # Used to generate artifact attestation + attestations: write steps: - uses: actions/download-artifact@v4 + - name: Generate artifact attestation + uses: actions/attest-build-provenance@v2 with: - pattern: wheels-* - merge-multiple: true - - uses: actions/download-artifact@v4 - with: - name: sdist - merge-multiple: true + subject-path: 'wheels-*/*' - name: Publish to PyPI + if: ${{ startsWith(github.ref, 'refs/tags/') }} uses: PyO3/maturin-action@v1 env: - PYO3_USE_ABI3_FORWARD_COMPATIBILITY: 1 MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_PASSWORD }} with: command: upload - args: --non-interactive --skip-existing * + args: --non-interactive --skip-existing wheels-*/* From 28161d088c990e6d8495cc67bb6030e533ff7c0b Mon Sep 17 00:00:00 2001 From: Anghelo Carvajal Date: Sat, 11 Oct 2025 14:51:40 -0300 Subject: [PATCH 03/18] Fix --- lib/src/gzip.rs | 2 +- lib/src/utils.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/src/gzip.rs b/lib/src/gzip.rs index 2287dd2..06180d4 100644 --- a/lib/src/gzip.rs +++ b/lib/src/gzip.rs @@ -1115,7 +1115,7 @@ pub fn compress(bytes: &[u8], level: usize, small_mem: bool) -> Result #[cfg(feature = "c_bindings")] mod c_bindings { - use std::ffi::c_int; + use core::ffi::c_int; #[no_mangle] pub extern "C" fn crunch64_gzip_compress_bound( diff --git a/lib/src/utils.rs b/lib/src/utils.rs index 529b927..7cf045d 100644 --- a/lib/src/utils.rs +++ b/lib/src/utils.rs @@ -36,12 +36,12 @@ pub fn read_u32(bytes: &[u8], offset: usize) -> Result { pub(crate) fn u8_vec_from_pointer_array( src_len: usize, src: *const u8, -) -> Result, Crunch64Error> { +) -> Result, Crunch64Error> { if src.is_null() { return Err(Crunch64Error::NullPointer); } - let mut bytes = Vec::with_capacity(src_len); + let mut bytes = alloc::vec::Vec::with_capacity(src_len); for i in 0..src_len { bytes.push(unsafe { *src.add(i) }); From dd28c69d383ed10688b0ed3f4cb415528ce84989 Mon Sep 17 00:00:00 2001 From: Anghelo Carvajal Date: Sat, 11 Oct 2025 14:55:35 -0300 Subject: [PATCH 04/18] fix maturin ci issues? --- Cargo.toml | 14 ++++++++++++++ cli/Cargo.toml | 10 +++++----- lib/Cargo.toml | 11 +++++------ 3 files changed, 24 insertions(+), 11 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 1695043..833f7e5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,3 +1,17 @@ [workspace] members = ["lib", "cli"] resolver = "2" + +[workspace.package] +# Version should be synced with lib/pyproject.toml and lib/crunch64/__init__.py +version = "0.5.4" +edition = "2021" +repository = "https://github.com/decompals/crunch64" +license = "MIT" + +# Use https://github.com/foresterre/cargo-msrv to check the MSRV +# ``` +# cargo install cargo-msrv --locked --force +# cargo msrv find -- cargo check -p crunch64 +# ``` +rust-version = "1.74.0" diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 4ebb183..3c36a02 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "crunch64-cli" -version = "0.5.4" -edition = "2021" +version.workspace = true +edition.workspace = true description = "A utility for compressing/decompressing files with common n64 formats" -repository = "https://github.com/decompals/crunch64" -license = "MIT" -rust-version = "1.74.0" +repository.workspace = true +license .workspace = true +rust-version.workspace = true [[bin]] name = "crunch64" diff --git a/lib/Cargo.toml b/lib/Cargo.toml index 05a4d7d..05f2dda 100644 --- a/lib/Cargo.toml +++ b/lib/Cargo.toml @@ -1,12 +1,11 @@ [package] name = "crunch64" -# Version should be synced with lib/pyproject.toml and lib/crunch64/__init__.py -version = "0.5.4" -edition = "2021" +version.workspace = true +edition.workspace = true description = "A library for handling common compression formats for N64 games" -repository = "https://github.com/decompals/crunch64" -license = "MIT" -rust-version = "1.74.0" +repository.workspace = true +license.workspace = true +rust-version.workspace = true categories = ["no-std"] [lib] From 69c3a0bfb791da1f4b6379223eebfb1789598991 Mon Sep 17 00:00:00 2001 From: Anghelo Carvajal Date: Sat, 11 Oct 2025 14:58:41 -0300 Subject: [PATCH 05/18] fix maturin ci issues??? --- .github/workflows/maturin_upload_pypi.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/maturin_upload_pypi.yml b/.github/workflows/maturin_upload_pypi.yml index fc03138..930f5f6 100644 --- a/.github/workflows/maturin_upload_pypi.yml +++ b/.github/workflows/maturin_upload_pypi.yml @@ -43,6 +43,7 @@ jobs: args: --release --out dist --find-interpreter sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} manylinux: auto + working-directory: lib/ - name: Upload wheels uses: actions/upload-artifact@v4 with: @@ -74,6 +75,7 @@ jobs: args: --release --out dist --find-interpreter sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} manylinux: musllinux_1_2 + working-directory: lib/ - name: Upload wheels uses: actions/upload-artifact@v4 with: @@ -101,6 +103,7 @@ jobs: target: ${{ matrix.platform.target }} args: --release --out dist --find-interpreter sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} + working-directory: lib/ - name: Upload wheels uses: actions/upload-artifact@v4 with: @@ -127,6 +130,7 @@ jobs: target: ${{ matrix.platform.target }} args: --release --out dist --find-interpreter sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} + working-directory: lib/ - name: Upload wheels uses: actions/upload-artifact@v4 with: @@ -142,6 +146,7 @@ jobs: with: command: sdist args: --out dist + working-directory: lib/ - name: Upload sdist uses: actions/upload-artifact@v4 with: From 0753734ec2b54503d2bcf5db474249f0837bf3b9 Mon Sep 17 00:00:00 2001 From: Anghelo Carvajal Date: Sat, 11 Oct 2025 15:01:52 -0300 Subject: [PATCH 06/18] version bump --- CHANGELOG.md | 6 +++++- Cargo.lock | 4 ++-- Cargo.toml | 2 +- cli/Cargo.toml | 2 +- lib/crunch64/__init__.py | 2 +- lib/pyproject.toml | 2 +- 6 files changed, 11 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dc08f0b..9ddfc94 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,9 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.6.0] - 2025-10-11 + ### Added - `no_std` support. +- Prebuilt binaries for Python 3.14. ## [0.5.4] - 2024-12-15 @@ -105,7 +108,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Python bindings. - C bindings. -[unreleased]: https://github.com/decompals/crunch64/compare/0.5.1...HEAD +[unreleased]: https://github.com/decompals/crunch64/compare/0.6.0...HEAD +[0.6.0]: https://github.com/decompals/crunch64/compare/0.5.3...0.6.0 [0.5.3]: https://github.com/decompals/crunch64/compare/0.5.2...0.5.3 [0.5.2]: https://github.com/decompals/crunch64/compare/0.5.1...0.5.2 [0.5.1]: https://github.com/decompals/crunch64/compare/0.5.0...0.5.1 diff --git a/Cargo.lock b/Cargo.lock index 2ebb36a..d093893 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -130,7 +130,7 @@ dependencies = [ [[package]] name = "crunch64" -version = "0.5.4" +version = "0.6.0" dependencies = [ "crc32fast", "pyo3", @@ -140,7 +140,7 @@ dependencies = [ [[package]] name = "crunch64-cli" -version = "0.5.4" +version = "0.6.0" dependencies = [ "clap", "crunch64", diff --git a/Cargo.toml b/Cargo.toml index 833f7e5..b95e8ad 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ resolver = "2" [workspace.package] # Version should be synced with lib/pyproject.toml and lib/crunch64/__init__.py -version = "0.5.4" +version = "0.6.0" edition = "2021" repository = "https://github.com/decompals/crunch64" license = "MIT" diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 3c36a02..46579a6 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -12,5 +12,5 @@ name = "crunch64" path = "src/main.rs" [dependencies] -crunch64 = { version = "0.5.4", path = "../lib" } +crunch64 = { version = "0.6.0", path = "../lib" } clap = { version = "4.4.11", features = ["derive"] } diff --git a/lib/crunch64/__init__.py b/lib/crunch64/__init__.py index 1a6a2cf..3362a43 100644 --- a/lib/crunch64/__init__.py +++ b/lib/crunch64/__init__.py @@ -3,7 +3,7 @@ from __future__ import annotations # Version should be synced with lib/Cargo.toml and lib/pyproject.toml -__version_info__ = (0, 5, 3) +__version_info__ = (0, 6, 0) __version__ = ".".join(map(str, __version_info__)) __author__ = "decompals" diff --git a/lib/pyproject.toml b/lib/pyproject.toml index 1aae951..2425672 100644 --- a/lib/pyproject.toml +++ b/lib/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "crunch64" # Version should be synced with lib/Cargo.toml and lib/crunch64/__init__.py -version = "0.5.4" +version = "0.6.0" description = "A library for handling common compression formats for N64 games" requires-python = ">=3.9" dependencies = [ From df4869dce27f59643db73d074d9574b907072572 Mon Sep 17 00:00:00 2001 From: Anghelo Carvajal Date: Sat, 11 Oct 2025 15:02:54 -0300 Subject: [PATCH 07/18] Update pyo3 --- Cargo.lock | 26 ++++++++++++-------------- lib/Cargo.toml | 2 +- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d093893..b8cd98b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -327,11 +327,10 @@ dependencies = [ [[package]] name = "pyo3" -version = "0.23.5" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7778bffd85cf38175ac1f545509665d0b9b92a198ca7941f131f85f7a4f9a872" +checksum = "7ba0117f4212101ee6544044dae45abe1083d30ce7b29c4b5cbdfa2354e07383" dependencies = [ - "cfg-if", "indoc", "libc", "memoffset", @@ -345,19 +344,18 @@ dependencies = [ [[package]] name = "pyo3-build-config" -version = "0.23.5" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94f6cbe86ef3bf18998d9df6e0f3fc1050a8c5efa409bf712e661a4366e010fb" +checksum = "4fc6ddaf24947d12a9aa31ac65431fb1b851b8f4365426e182901eabfb87df5f" dependencies = [ - "once_cell", "target-lexicon", ] [[package]] name = "pyo3-ffi" -version = "0.23.5" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9f1b4c431c0bb1c8fb0a338709859eed0d030ff6daa34368d3b152a63dfdd8d" +checksum = "025474d3928738efb38ac36d4744a74a400c901c7596199e20e45d98eb194105" dependencies = [ "libc", "pyo3-build-config", @@ -365,9 +363,9 @@ dependencies = [ [[package]] name = "pyo3-macros" -version = "0.23.5" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc2201328f63c4710f68abdf653c89d8dbc2858b88c5d88b0ff38a75288a9da" +checksum = "2e64eb489f22fe1c95911b77c44cc41e7c19f3082fc81cce90f657cdc42ffded" dependencies = [ "proc-macro2", "pyo3-macros-backend", @@ -377,9 +375,9 @@ dependencies = [ [[package]] name = "pyo3-macros-backend" -version = "0.23.5" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fca6726ad0f3da9c9de093d6f116a93c1a38e417ed73bf138472cf4064f72028" +checksum = "100246c0ecf400b475341b8455a9213344569af29a3c841d29270e53102e0fcf" dependencies = [ "heck", "proc-macro2", @@ -501,9 +499,9 @@ dependencies = [ [[package]] name = "target-lexicon" -version = "0.12.16" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" +checksum = "df7f62577c25e07834649fc3b39fafdc597c0a3527dc1c60129201ccfcbaa50c" [[package]] name = "thiserror" diff --git a/lib/Cargo.toml b/lib/Cargo.toml index 05f2dda..1727d73 100644 --- a/lib/Cargo.toml +++ b/lib/Cargo.toml @@ -15,7 +15,7 @@ crate-type = ["lib", "staticlib", "cdylib"] [dependencies] crc32fast = "1.4.2" -pyo3 = { version="0.23.5", features = ["extension-module"], optional = true } +pyo3 = { version="0.26", features = ["extension-module"], optional = true } thiserror = { version="2", default-features = false } [dev-dependencies] From be46c79c5cdb21b5b76546d36c863bbcc75e5e68 Mon Sep 17 00:00:00 2001 From: Anghelo Carvajal Date: Sat, 11 Oct 2025 15:05:34 -0300 Subject: [PATCH 08/18] mention alloc --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ddfc94..2b43cd2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - `no_std` support. + - `alloc` is still required. - Prebuilt binaries for Python 3.14. ## [0.5.4] - 2024-12-15 From f51d338d732c888f64c2e6f5c972082ff3c3bc6f Mon Sep 17 00:00:00 2001 From: Anghelo Carvajal Date: Mon, 13 Oct 2025 22:41:15 -0300 Subject: [PATCH 09/18] Try to increase Python version support --- lib/Cargo.toml | 2 +- lib/pyproject.toml | 2 +- mypy.ini | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Cargo.toml b/lib/Cargo.toml index 1727d73..8ef9595 100644 --- a/lib/Cargo.toml +++ b/lib/Cargo.toml @@ -15,7 +15,7 @@ crate-type = ["lib", "staticlib", "cdylib"] [dependencies] crc32fast = "1.4.2" -pyo3 = { version="0.26", features = ["extension-module"], optional = true } +pyo3 = { version="0.26", features = ["extension-module", "abi3"], optional = true } thiserror = { version="2", default-features = false } [dev-dependencies] diff --git a/lib/pyproject.toml b/lib/pyproject.toml index 2425672..ab1c4ac 100644 --- a/lib/pyproject.toml +++ b/lib/pyproject.toml @@ -3,7 +3,7 @@ name = "crunch64" # Version should be synced with lib/Cargo.toml and lib/crunch64/__init__.py version = "0.6.0" description = "A library for handling common compression formats for N64 games" -requires-python = ">=3.9" +# requires-python = ">=3.9" dependencies = [ ] classifiers = [ diff --git a/mypy.ini b/mypy.ini index 2145f40..3045a82 100644 --- a/mypy.ini +++ b/mypy.ini @@ -1,3 +1,3 @@ [mypy] -python_version = 3.9 +# python_version = 3.9 check_untyped_defs = True From 89e41b9ce068f1f950dedfa14ceeac5af7a3d964 Mon Sep 17 00:00:00 2001 From: Anghelo Carvajal Date: Mon, 13 Oct 2025 22:44:24 -0300 Subject: [PATCH 10/18] Fix dist path --- .github/workflows/maturin_upload_pypi.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/maturin_upload_pypi.yml b/.github/workflows/maturin_upload_pypi.yml index 930f5f6..c030e8a 100644 --- a/.github/workflows/maturin_upload_pypi.yml +++ b/.github/workflows/maturin_upload_pypi.yml @@ -40,7 +40,7 @@ jobs: uses: PyO3/maturin-action@v1 with: target: ${{ matrix.platform.target }} - args: --release --out dist --find-interpreter + args: --release --out ../dist --find-interpreter sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} manylinux: auto working-directory: lib/ @@ -72,7 +72,7 @@ jobs: uses: PyO3/maturin-action@v1 with: target: ${{ matrix.platform.target }} - args: --release --out dist --find-interpreter + args: --release --out ../dist --find-interpreter sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} manylinux: musllinux_1_2 working-directory: lib/ @@ -101,7 +101,7 @@ jobs: uses: PyO3/maturin-action@v1 with: target: ${{ matrix.platform.target }} - args: --release --out dist --find-interpreter + args: --release --out ../dist --find-interpreter sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} working-directory: lib/ - name: Upload wheels @@ -128,7 +128,7 @@ jobs: uses: PyO3/maturin-action@v1 with: target: ${{ matrix.platform.target }} - args: --release --out dist --find-interpreter + args: --release --out ../dist --find-interpreter sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} working-directory: lib/ - name: Upload wheels @@ -145,7 +145,7 @@ jobs: uses: PyO3/maturin-action@v1 with: command: sdist - args: --out dist + args: --out ../dist working-directory: lib/ - name: Upload sdist uses: actions/upload-artifact@v4 From 8e49b11e63cc2b6e795b58d03c48447bb48da019 Mon Sep 17 00:00:00 2001 From: Anghelo Carvajal Date: Mon, 13 Oct 2025 22:54:41 -0300 Subject: [PATCH 11/18] Set PYO3_USE_ABI3_FORWARD_COMPATIBILITY again --- .github/workflows/maturin_upload_pypi.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/maturin_upload_pypi.yml b/.github/workflows/maturin_upload_pypi.yml index c030e8a..1596892 100644 --- a/.github/workflows/maturin_upload_pypi.yml +++ b/.github/workflows/maturin_upload_pypi.yml @@ -38,6 +38,8 @@ jobs: python-version: 3.x - name: Build wheels uses: PyO3/maturin-action@v1 + env: + PYO3_USE_ABI3_FORWARD_COMPATIBILITY: 1 with: target: ${{ matrix.platform.target }} args: --release --out ../dist --find-interpreter @@ -70,6 +72,8 @@ jobs: python-version: 3.x - name: Build wheels uses: PyO3/maturin-action@v1 + env: + PYO3_USE_ABI3_FORWARD_COMPATIBILITY: 1 with: target: ${{ matrix.platform.target }} args: --release --out ../dist --find-interpreter @@ -99,6 +103,8 @@ jobs: architecture: ${{ matrix.platform.target }} - name: Build wheels uses: PyO3/maturin-action@v1 + env: + PYO3_USE_ABI3_FORWARD_COMPATIBILITY: 1 with: target: ${{ matrix.platform.target }} args: --release --out ../dist --find-interpreter @@ -126,6 +132,8 @@ jobs: python-version: 3.x - name: Build wheels uses: PyO3/maturin-action@v1 + env: + PYO3_USE_ABI3_FORWARD_COMPATIBILITY: 1 with: target: ${{ matrix.platform.target }} args: --release --out ../dist --find-interpreter @@ -143,6 +151,8 @@ jobs: - uses: actions/checkout@main - name: Build sdist uses: PyO3/maturin-action@v1 + env: + PYO3_USE_ABI3_FORWARD_COMPATIBILITY: 1 with: command: sdist args: --out ../dist From 2bbe15bbb6db255ea09c9bc7a72d60ed2ee76cb7 Mon Sep 17 00:00:00 2001 From: Anghelo Carvajal Date: Mon, 13 Oct 2025 23:08:41 -0300 Subject: [PATCH 12/18] More fixups --- .github/workflows/maturin_upload_pypi.yml | 24 ++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/.github/workflows/maturin_upload_pypi.yml b/.github/workflows/maturin_upload_pypi.yml index 1596892..ee9167a 100644 --- a/.github/workflows/maturin_upload_pypi.yml +++ b/.github/workflows/maturin_upload_pypi.yml @@ -35,7 +35,7 @@ jobs: - uses: actions/checkout@main - uses: actions/setup-python@v5 with: - python-version: 3.x + python-version: '3.8 - 3.14' - name: Build wheels uses: PyO3/maturin-action@v1 env: @@ -47,10 +47,11 @@ jobs: manylinux: auto working-directory: lib/ - name: Upload wheels - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@main with: name: wheels-linux-${{ matrix.platform.target }} path: dist + if-no-files-found: error musllinux: runs-on: ${{ matrix.platform.runner }} @@ -69,7 +70,7 @@ jobs: - uses: actions/checkout@main - uses: actions/setup-python@v5 with: - python-version: 3.x + python-version: '3.8 - 3.14' - name: Build wheels uses: PyO3/maturin-action@v1 env: @@ -81,10 +82,11 @@ jobs: manylinux: musllinux_1_2 working-directory: lib/ - name: Upload wheels - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@main with: name: wheels-musllinux-${{ matrix.platform.target }} path: dist + if-no-files-found: error windows: runs-on: ${{ matrix.platform.runner }} @@ -99,7 +101,7 @@ jobs: - uses: actions/checkout@main - uses: actions/setup-python@v5 with: - python-version: 3.x + python-version: '3.8 - 3.14' architecture: ${{ matrix.platform.target }} - name: Build wheels uses: PyO3/maturin-action@v1 @@ -111,10 +113,11 @@ jobs: sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} working-directory: lib/ - name: Upload wheels - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@main with: name: wheels-windows-${{ matrix.platform.target }} path: dist + if-no-files-found: error macos: runs-on: ${{ matrix.platform.runner }} @@ -129,7 +132,7 @@ jobs: - uses: actions/checkout@main - uses: actions/setup-python@v5 with: - python-version: 3.x + python-version: '3.8 - 3.14' - name: Build wheels uses: PyO3/maturin-action@v1 env: @@ -140,10 +143,11 @@ jobs: sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} working-directory: lib/ - name: Upload wheels - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@main with: name: wheels-macos-${{ matrix.platform.target }} path: dist + if-no-files-found: error sdist: runs-on: ubuntu-latest @@ -158,10 +162,11 @@ jobs: args: --out ../dist working-directory: lib/ - name: Upload sdist - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@main with: name: wheels-sdist path: dist + if-no-files-found: error check_clippy_python_bindings: name: Check clippy for Python bindings @@ -205,6 +210,7 @@ jobs: uses: PyO3/maturin-action@v1 env: MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_PASSWORD }} + PYO3_USE_ABI3_FORWARD_COMPATIBILITY: 1 with: command: upload args: --non-interactive --skip-existing wheels-*/* From ed84504f7e4efdf916b345aa288cef8b1cdc2bb7 Mon Sep 17 00:00:00 2001 From: Anghelo Carvajal Date: Mon, 13 Oct 2025 23:19:39 -0300 Subject: [PATCH 13/18] Run tests in multiple python versions --- .github/workflows/maturin_upload_pypi.yml | 8 ++--- .github/workflows/mypy.yml | 18 +++++++++-- .github/workflows/python_bindings.yml | 37 ++++++++++++++++------- 3 files changed, 45 insertions(+), 18 deletions(-) diff --git a/.github/workflows/maturin_upload_pypi.yml b/.github/workflows/maturin_upload_pypi.yml index ee9167a..9ce6f99 100644 --- a/.github/workflows/maturin_upload_pypi.yml +++ b/.github/workflows/maturin_upload_pypi.yml @@ -35,7 +35,7 @@ jobs: - uses: actions/checkout@main - uses: actions/setup-python@v5 with: - python-version: '3.8 - 3.14' + python-version: '3.7 - 3.14' - name: Build wheels uses: PyO3/maturin-action@v1 env: @@ -70,7 +70,7 @@ jobs: - uses: actions/checkout@main - uses: actions/setup-python@v5 with: - python-version: '3.8 - 3.14' + python-version: '3.7 - 3.14' - name: Build wheels uses: PyO3/maturin-action@v1 env: @@ -101,7 +101,7 @@ jobs: - uses: actions/checkout@main - uses: actions/setup-python@v5 with: - python-version: '3.8 - 3.14' + python-version: '3.7 - 3.14' architecture: ${{ matrix.platform.target }} - name: Build wheels uses: PyO3/maturin-action@v1 @@ -132,7 +132,7 @@ jobs: - uses: actions/checkout@main - uses: actions/setup-python@v5 with: - python-version: '3.8 - 3.14' + python-version: '3.7 - 3.14' - name: Build wheels uses: PyO3/maturin-action@v1 env: diff --git a/.github/workflows/mypy.yml b/.github/workflows/mypy.yml index 305e42f..d7a4126 100644 --- a/.github/workflows/mypy.yml +++ b/.github/workflows/mypy.yml @@ -5,15 +5,27 @@ on: [push, pull_request] jobs: checks: + name: mypy Python ${{ matrix.py_version }} runs-on: ubuntu-latest - name: mypy + strategy: + matrix: + py_version: + - '3.7' + - '3.8' + - '3.9' + - '3.10' + - '3.11' + - '3.12' + - '3.13' + - '3.14' + steps: - uses: actions/checkout@v5 - - name: Set up Python 3.9 + - name: Set up Python ${{ matrix.py_version }} uses: actions/setup-python@v5 with: - python-version: 3.9 + python-version: ${{ matrix.py_version }} - name: Install Dependencies run: | diff --git a/.github/workflows/python_bindings.yml b/.github/workflows/python_bindings.yml index 73a451b..fc55b8d 100644 --- a/.github/workflows/python_bindings.yml +++ b/.github/workflows/python_bindings.yml @@ -5,21 +5,36 @@ on: [push, pull_request] jobs: tests_cases: - name: Tests cases + name: Test for Python ${{ matrix.py_version }} runs-on: ubuntu-latest strategy: - fail-fast: false + matrix: + py_version: + - '3.7' + - '3.8' + - '3.9' + - '3.10' + - '3.11' + - '3.12' + - '3.13' + - '3.14' steps: - - name: Checkout repo - uses: actions/checkout@v5 + - name: Checkout repo + uses: actions/checkout@v5 - - name: Setup requirements - run: | - python3 -m pip install -U maturin + - name: Setup Python ${{ matrix.py_version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.py_version }} - - name: Install local crunch64 - run: python3 -m pip install ./lib + - name: Setup requirements + run: | + python3 --version + python3 -m pip install -U maturin - - name: Run tests - run: python3 ./python_bindings/tests.py + - name: Install local crunch64 + run: python3 -m pip install ./lib + + - name: Run tests + run: python3 ./python_bindings/tests.py From d9ae9af562199265e1edf0953b8d4c65eae76458 Mon Sep 17 00:00:00 2001 From: Anghelo Carvajal Date: Mon, 13 Oct 2025 23:33:44 -0300 Subject: [PATCH 14/18] Setup multiple pypy versions too --- .github/workflows/maturin_upload_pypi.yml | 28 +++++++++++++++++++---- .github/workflows/mypy.yml | 2 +- .github/workflows/python_bindings.yml | 2 +- lib/pyproject.toml | 1 - mypy.ini | 1 - 5 files changed, 26 insertions(+), 8 deletions(-) diff --git a/.github/workflows/maturin_upload_pypi.yml b/.github/workflows/maturin_upload_pypi.yml index 9ce6f99..1fbe7a7 100644 --- a/.github/workflows/maturin_upload_pypi.yml +++ b/.github/workflows/maturin_upload_pypi.yml @@ -35,7 +35,12 @@ jobs: - uses: actions/checkout@main - uses: actions/setup-python@v5 with: - python-version: '3.7 - 3.14' + python-version: | + '3.8 - 3.14' + 'pypy3.8' + 'pypy3.9' + 'pypy3.10' + 'pypy3.11' - name: Build wheels uses: PyO3/maturin-action@v1 env: @@ -70,7 +75,12 @@ jobs: - uses: actions/checkout@main - uses: actions/setup-python@v5 with: - python-version: '3.7 - 3.14' + python-version: | + '3.8 - 3.14' + 'pypy3.8' + 'pypy3.9' + 'pypy3.10' + 'pypy3.11' - name: Build wheels uses: PyO3/maturin-action@v1 env: @@ -101,7 +111,12 @@ jobs: - uses: actions/checkout@main - uses: actions/setup-python@v5 with: - python-version: '3.7 - 3.14' + python-version: | + '3.8 - 3.14' + 'pypy3.8' + 'pypy3.9' + 'pypy3.10' + 'pypy3.11' architecture: ${{ matrix.platform.target }} - name: Build wheels uses: PyO3/maturin-action@v1 @@ -132,7 +147,12 @@ jobs: - uses: actions/checkout@main - uses: actions/setup-python@v5 with: - python-version: '3.7 - 3.14' + python-version: | + '3.8 - 3.14' + 'pypy3.8' + 'pypy3.9' + 'pypy3.10' + 'pypy3.11' - name: Build wheels uses: PyO3/maturin-action@v1 env: diff --git a/.github/workflows/mypy.yml b/.github/workflows/mypy.yml index d7a4126..b409f85 100644 --- a/.github/workflows/mypy.yml +++ b/.github/workflows/mypy.yml @@ -8,9 +8,9 @@ jobs: name: mypy Python ${{ matrix.py_version }} runs-on: ubuntu-latest strategy: + fail-fast: false matrix: py_version: - - '3.7' - '3.8' - '3.9' - '3.10' diff --git a/.github/workflows/python_bindings.yml b/.github/workflows/python_bindings.yml index fc55b8d..2a9c8b3 100644 --- a/.github/workflows/python_bindings.yml +++ b/.github/workflows/python_bindings.yml @@ -8,9 +8,9 @@ jobs: name: Test for Python ${{ matrix.py_version }} runs-on: ubuntu-latest strategy: + fail-fast: false matrix: py_version: - - '3.7' - '3.8' - '3.9' - '3.10' diff --git a/lib/pyproject.toml b/lib/pyproject.toml index ab1c4ac..2e94a7c 100644 --- a/lib/pyproject.toml +++ b/lib/pyproject.toml @@ -3,7 +3,6 @@ name = "crunch64" # Version should be synced with lib/Cargo.toml and lib/crunch64/__init__.py version = "0.6.0" description = "A library for handling common compression formats for N64 games" -# requires-python = ">=3.9" dependencies = [ ] classifiers = [ diff --git a/mypy.ini b/mypy.ini index 3045a82..31671bd 100644 --- a/mypy.ini +++ b/mypy.ini @@ -1,3 +1,2 @@ [mypy] -# python_version = 3.9 check_untyped_defs = True From bca06cbc29924b1355f8de461ca9e5cc795157a6 Mon Sep 17 00:00:00 2001 From: Anghelo Carvajal Date: Mon, 13 Oct 2025 23:36:09 -0300 Subject: [PATCH 15/18] Remove quotes from py versions? --- .github/workflows/maturin_upload_pypi.yml | 44 ++++++++++++----------- .github/workflows/mypy.yml | 1 + .github/workflows/python_bindings.yml | 1 + 3 files changed, 26 insertions(+), 20 deletions(-) diff --git a/.github/workflows/maturin_upload_pypi.yml b/.github/workflows/maturin_upload_pypi.yml index 1fbe7a7..e29015c 100644 --- a/.github/workflows/maturin_upload_pypi.yml +++ b/.github/workflows/maturin_upload_pypi.yml @@ -36,11 +36,12 @@ jobs: - uses: actions/setup-python@v5 with: python-version: | - '3.8 - 3.14' - 'pypy3.8' - 'pypy3.9' - 'pypy3.10' - 'pypy3.11' + 3.8 - 3.14 + 3.x + pypy3.8 + pypy3.9 + pypy3.10 + pypy3.11 - name: Build wheels uses: PyO3/maturin-action@v1 env: @@ -76,11 +77,12 @@ jobs: - uses: actions/setup-python@v5 with: python-version: | - '3.8 - 3.14' - 'pypy3.8' - 'pypy3.9' - 'pypy3.10' - 'pypy3.11' + 3.8 - 3.14 + 3.x + pypy3.8 + pypy3.9 + pypy3.10 + pypy3.11 - name: Build wheels uses: PyO3/maturin-action@v1 env: @@ -112,11 +114,12 @@ jobs: - uses: actions/setup-python@v5 with: python-version: | - '3.8 - 3.14' - 'pypy3.8' - 'pypy3.9' - 'pypy3.10' - 'pypy3.11' + 3.8 - 3.14 + 3.x + pypy3.8 + pypy3.9 + pypy3.10 + pypy3.11 architecture: ${{ matrix.platform.target }} - name: Build wheels uses: PyO3/maturin-action@v1 @@ -148,11 +151,12 @@ jobs: - uses: actions/setup-python@v5 with: python-version: | - '3.8 - 3.14' - 'pypy3.8' - 'pypy3.9' - 'pypy3.10' - 'pypy3.11' + 3.8 - 3.14 + 3.x + pypy3.8 + pypy3.9 + pypy3.10 + pypy3.11 - name: Build wheels uses: PyO3/maturin-action@v1 env: diff --git a/.github/workflows/mypy.yml b/.github/workflows/mypy.yml index b409f85..8597440 100644 --- a/.github/workflows/mypy.yml +++ b/.github/workflows/mypy.yml @@ -18,6 +18,7 @@ jobs: - '3.12' - '3.13' - '3.14' + - '3.x' # Explicit latest steps: - uses: actions/checkout@v5 diff --git a/.github/workflows/python_bindings.yml b/.github/workflows/python_bindings.yml index 2a9c8b3..3aed5ee 100644 --- a/.github/workflows/python_bindings.yml +++ b/.github/workflows/python_bindings.yml @@ -18,6 +18,7 @@ jobs: - '3.12' - '3.13' - '3.14' + - '3.x' # Explicit latest steps: - name: Checkout repo From e01d252016a62246a017855be15a98a0c1d53d80 Mon Sep 17 00:00:00 2001 From: Anghelo Carvajal Date: Mon, 13 Oct 2025 23:42:37 -0300 Subject: [PATCH 16/18] Remove pypy3.8 --- .github/workflows/maturin_upload_pypi.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/maturin_upload_pypi.yml b/.github/workflows/maturin_upload_pypi.yml index e29015c..5052105 100644 --- a/.github/workflows/maturin_upload_pypi.yml +++ b/.github/workflows/maturin_upload_pypi.yml @@ -113,10 +113,10 @@ jobs: - uses: actions/checkout@main - uses: actions/setup-python@v5 with: + # We can't use pypy3.8 in CI python-version: | 3.8 - 3.14 3.x - pypy3.8 pypy3.9 pypy3.10 pypy3.11 @@ -150,10 +150,10 @@ jobs: - uses: actions/checkout@main - uses: actions/setup-python@v5 with: + # We can't use pypy3.8 in CI python-version: | 3.8 - 3.14 3.x - pypy3.8 pypy3.9 pypy3.10 pypy3.11 From 42dd615d779cbc492444714af8af54e31a775b25 Mon Sep 17 00:00:00 2001 From: Anghelo Carvajal Date: Mon, 13 Oct 2025 23:51:20 -0300 Subject: [PATCH 17/18] changelog --- .github/workflows/maturin_upload_pypi.yml | 5 ++--- CHANGELOG.md | 8 ++++++++ lib/pyproject.toml | 1 + 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/maturin_upload_pypi.yml b/.github/workflows/maturin_upload_pypi.yml index 5052105..a1fdefb 100644 --- a/.github/workflows/maturin_upload_pypi.yml +++ b/.github/workflows/maturin_upload_pypi.yml @@ -113,13 +113,12 @@ jobs: - uses: actions/checkout@main - uses: actions/setup-python@v5 with: - # We can't use pypy3.8 in CI + # We can't use pypy3.8 nor pypy3.11 in CI python-version: | 3.8 - 3.14 3.x pypy3.9 pypy3.10 - pypy3.11 architecture: ${{ matrix.platform.target }} - name: Build wheels uses: PyO3/maturin-action@v1 @@ -233,8 +232,8 @@ jobs: if: ${{ startsWith(github.ref, 'refs/tags/') }} uses: PyO3/maturin-action@v1 env: - MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_PASSWORD }} PYO3_USE_ABI3_FORWARD_COMPATIBILITY: 1 + MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_PASSWORD }} with: command: upload args: --non-interactive --skip-existing wheels-*/* diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b43cd2..db45233 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `no_std` support. - `alloc` is still required. - Prebuilt binaries for Python 3.14. +- Prebuilt binaries for Python 3.8. + +### Changed + +- Python 3.8 is supported again. + - CI allows us to build for 3.8 again. +- Change the hard requirement of Python 3.9 to just Python 3 in the package metadata. + - Note there's no official support for Python versions older than 3.8. ## [0.5.4] - 2024-12-15 diff --git a/lib/pyproject.toml b/lib/pyproject.toml index 2e94a7c..4d1be01 100644 --- a/lib/pyproject.toml +++ b/lib/pyproject.toml @@ -3,6 +3,7 @@ name = "crunch64" # Version should be synced with lib/Cargo.toml and lib/crunch64/__init__.py version = "0.6.0" description = "A library for handling common compression formats for N64 games" +requires-python = ">=3.0" dependencies = [ ] classifiers = [ From 5487342f415c2fd081ff627b7285f3f16d87535d Mon Sep 17 00:00:00 2001 From: Anghelo Carvajal Date: Tue, 14 Oct 2025 17:22:13 -0300 Subject: [PATCH 18/18] setup-python@v6 --- .github/workflows/maturin_upload_pypi.yml | 8 ++++---- .github/workflows/mypy.yml | 2 +- .github/workflows/python_bindings.yml | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/maturin_upload_pypi.yml b/.github/workflows/maturin_upload_pypi.yml index a1fdefb..b322394 100644 --- a/.github/workflows/maturin_upload_pypi.yml +++ b/.github/workflows/maturin_upload_pypi.yml @@ -33,7 +33,7 @@ jobs: target: ppc64le steps: - uses: actions/checkout@main - - uses: actions/setup-python@v5 + - uses: actions/setup-python@v6 with: python-version: | 3.8 - 3.14 @@ -74,7 +74,7 @@ jobs: target: armv7 steps: - uses: actions/checkout@main - - uses: actions/setup-python@v5 + - uses: actions/setup-python@v6 with: python-version: | 3.8 - 3.14 @@ -111,7 +111,7 @@ jobs: target: x86 steps: - uses: actions/checkout@main - - uses: actions/setup-python@v5 + - uses: actions/setup-python@v6 with: # We can't use pypy3.8 nor pypy3.11 in CI python-version: | @@ -147,7 +147,7 @@ jobs: target: aarch64 steps: - uses: actions/checkout@main - - uses: actions/setup-python@v5 + - uses: actions/setup-python@v6 with: # We can't use pypy3.8 in CI python-version: | diff --git a/.github/workflows/mypy.yml b/.github/workflows/mypy.yml index 8597440..b0efdf6 100644 --- a/.github/workflows/mypy.yml +++ b/.github/workflows/mypy.yml @@ -24,7 +24,7 @@ jobs: - uses: actions/checkout@v5 - name: Set up Python ${{ matrix.py_version }} - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: ${{ matrix.py_version }} diff --git a/.github/workflows/python_bindings.yml b/.github/workflows/python_bindings.yml index 3aed5ee..46473e2 100644 --- a/.github/workflows/python_bindings.yml +++ b/.github/workflows/python_bindings.yml @@ -25,7 +25,7 @@ jobs: uses: actions/checkout@v5 - name: Setup Python ${{ matrix.py_version }} - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: ${{ matrix.py_version }}