From ce0707776c1a671be093940c5ba5355fc88322c5 Mon Sep 17 00:00:00 2001 From: Robin Date: Tue, 8 Jul 2025 18:53:05 +0200 Subject: [PATCH 1/3] update deps, switch to uv --- .github/workflows/CI.yml | 67 ++++++++++++++++++++++++++++++---------- .gitignore | 3 ++ Cargo.lock | 65 +++++++++++++++++++------------------- Cargo.toml | 2 +- pyproject.toml | 2 +- uv.lock | 7 +++++ 6 files changed, 95 insertions(+), 51 deletions(-) create mode 100644 uv.lock diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index a9ec76b..28fc361 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -58,10 +58,12 @@ jobs: shell: bash run: | set -e + curl -LsSf https://astral.sh/uv/install.sh | sh + export PATH="$HOME/.local/bin:$PATH" python3 -m venv .venv source .venv/bin/activate - pip install pycrc32 --find-links dist --force-reinstall - pip install pytest + uv pip install pycrc32 --find-links dist --force-reinstall + uv pip install pytest pytest - name: pytest if: ${{ !startsWith(matrix.platform.target, 'x86') && matrix.platform.target != 'ppc64' }} @@ -72,11 +74,14 @@ jobs: githubToken: ${{ github.token }} install: | apt-get update - apt-get install -y --no-install-recommends python3 python3-pip - pip3 install -U pip pytest + apt-get install -y --no-install-recommends python3 python3-pip curl + curl -LsSf https://astral.sh/uv/install.sh | sh + export PATH="$HOME/.local/bin:$PATH" + uv pip install --system pytest run: | set -e - pip3 install pycrc32 --find-links dist --force-reinstall + export PATH="$HOME/.local/bin:$PATH" + uv pip install --system pycrc32 --find-links dist --force-reinstall pytest musllinux: @@ -117,11 +122,13 @@ jobs: options: -v ${{ github.workspace }}:/io -w /io run: | set -e - apk add py3-pip py3-virtualenv + apk add py3-pip py3-virtualenv curl + curl -LsSf https://astral.sh/uv/install.sh | sh + export PATH="$HOME/.local/bin:$PATH" python3 -m virtualenv .venv source .venv/bin/activate - pip install pycrc32 --no-index --find-links dist --force-reinstall - pip install pytest + uv pip install pycrc32 --no-index --find-links dist --force-reinstall + uv pip install pytest pytest - name: pytest if: ${{ !startsWith(matrix.platform.target, 'x86') }} @@ -131,13 +138,15 @@ jobs: distro: alpine_latest githubToken: ${{ github.token }} install: | - apk add py3-virtualenv + apk add py3-virtualenv curl + curl -LsSf https://astral.sh/uv/install.sh | sh run: | set -e + export PATH="$HOME/.local/bin:$PATH" python3 -m virtualenv .venv source .venv/bin/activate - pip install pytest - pip install pycrc32 --find-links dist --force-reinstall + uv pip install pytest + uv pip install pycrc32 --find-links dist --force-reinstall pytest windows: @@ -171,10 +180,12 @@ jobs: shell: bash run: | set -e + curl -LsSf https://astral.sh/uv/install.sh | sh + export PATH="$HOME/.local/bin:$PATH" python3 -m venv .venv source .venv/Scripts/activate - pip install pycrc32 --find-links dist --force-reinstall - pip install pytest + uv pip install pycrc32 --find-links dist --force-reinstall + uv pip install pytest pytest macos: @@ -205,10 +216,12 @@ jobs: - name: pytest run: | set -e + curl -LsSf https://astral.sh/uv/install.sh | sh + export PATH="$HOME/.local/bin:$PATH" python3 -m venv .venv source .venv/bin/activate - pip install pycrc32 --find-links dist --force-reinstall - pip install pytest + uv pip install pycrc32 --find-links dist --force-reinstall + uv pip install pytest pytest sdist: @@ -226,11 +239,33 @@ jobs: name: wheels-sdist path: dist + test-python-versions: + name: Test Python versions + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + - name: Install uv + run: | + curl -LsSf https://astral.sh/uv/install.sh | sh + echo "$HOME/.local/bin" >> $GITHUB_PATH + - name: Build and test + run: | + uv tool install maturin + maturin develop + uv pip install pytest + pytest + release: name: Release runs-on: ubuntu-latest if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }} - needs: [linux, musllinux, windows, macos, sdist] + needs: [linux, musllinux, windows, macos, sdist, test-python-versions] permissions: # Use to sign the release artifacts id-token: write diff --git a/.gitignore b/.gitignore index c8f0442..018822a 100644 --- a/.gitignore +++ b/.gitignore @@ -70,3 +70,6 @@ docs/_build/ # Pyenv .python-version + +CLAUDE.md +GEMINI.md diff --git a/Cargo.lock b/Cargo.lock index 2d39ec8..605465b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,15 +4,15 @@ version = 4 [[package]] name = "autocfg" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" [[package]] name = "cfg-if" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" [[package]] name = "crc32fast" @@ -31,15 +31,15 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "indoc" -version = "2.0.5" +version = "2.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5" +checksum = "f4c7245a08504955605670dbf141fceab975f15ca21570696aebe9d2e71576bd" [[package]] name = "libc" -version = "0.2.168" +version = "0.2.174" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aaeb2981e0606ca11d79718f8bb01164f1d6ed75080182d3abf017e6d244b6d" +checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776" [[package]] name = "memoffset" @@ -52,21 +52,21 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.20.2" +version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" [[package]] name = "portable-atomic" -version = "1.10.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "280dc24453071f1b63954171985a0b0d30058d287960968b9b2aca264c8d4ee6" +checksum = "f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483" [[package]] name = "proc-macro2" -version = "1.0.92" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" dependencies = [ "unicode-ident", ] @@ -81,11 +81,10 @@ dependencies = [ [[package]] name = "pyo3" -version = "0.24.0" +version = "0.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f1c6c3591120564d64db2261bec5f910ae454f01def849b9c22835a84695e86" +checksum = "8970a78afe0628a3e3430376fc5fd76b6b45c4d43360ffd6cdd40bdde72b682a" dependencies = [ - "cfg-if", "indoc", "libc", "memoffset", @@ -99,9 +98,9 @@ dependencies = [ [[package]] name = "pyo3-build-config" -version = "0.24.0" +version = "0.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9b6c2b34cf71427ea37c7001aefbaeb85886a074795e35f161f5aecc7620a7a" +checksum = "458eb0c55e7ece017adeba38f2248ff3ac615e53660d7c71a238d7d2a01c7598" dependencies = [ "once_cell", "target-lexicon", @@ -109,9 +108,9 @@ dependencies = [ [[package]] name = "pyo3-ffi" -version = "0.24.0" +version = "0.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5507651906a46432cdda02cd02dd0319f6064f1374c9147c45b978621d2c3a9c" +checksum = "7114fe5457c61b276ab77c5055f206295b812608083644a5c5b2640c3102565c" dependencies = [ "libc", "pyo3-build-config", @@ -119,9 +118,9 @@ dependencies = [ [[package]] name = "pyo3-macros" -version = "0.24.0" +version = "0.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0d394b5b4fd8d97d48336bb0dd2aebabad39f1d294edd6bcd2cccf2eefe6f42" +checksum = "a8725c0a622b374d6cb051d11a0983786448f7785336139c3c94f5aa6bef7e50" dependencies = [ "proc-macro2", "pyo3-macros-backend", @@ -131,9 +130,9 @@ dependencies = [ [[package]] name = "pyo3-macros-backend" -version = "0.24.0" +version = "0.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd72da09cfa943b1080f621f024d2ef7e2773df7badd51aa30a2be1f8caa7c8e" +checksum = "4109984c22491085343c05b0dbc54ddc405c3cf7b4374fc533f5c3313a572ccc" dependencies = [ "heck", "proc-macro2", @@ -144,18 +143,18 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.37" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" dependencies = [ "proc-macro2", ] [[package]] name = "syn" -version = "2.0.90" +version = "2.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" +checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40" dependencies = [ "proc-macro2", "quote", @@ -170,12 +169,12 @@ checksum = "e502f78cdbb8ba4718f566c418c52bc729126ffd16baee5baa718cf25dd5a69a" [[package]] name = "unicode-ident" -version = "1.0.14" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" [[package]] name = "unindent" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7de7d73e1754487cb58364ee906a499937a0dfabd86bcb980fa99ec8c8fa2ce" +checksum = "7264e107f553ccae879d21fbea1d6724ac785e8c3bfc762137959b5802826ef3" diff --git a/Cargo.toml b/Cargo.toml index 553ccf6..81f6504 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,5 +16,5 @@ crate-type = ["cdylib"] [dependencies] crc32fast = "1.4.2" -pyo3 = "0.24.0" +pyo3 = "0.25.1" diff --git a/pyproject.toml b/pyproject.toml index 9e9a8c3..10fc520 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,7 +36,7 @@ Homepage = "https://github.com/code-inflation/pycrc32" Repository = "https://github.com/code-inflation/pycrc32" [build-system] -requires = ["maturin>=1.4,<2.0"] +requires = ["maturin>=1.9,<2.0"] build-backend = "maturin" [tool.maturin] diff --git a/uv.lock b/uv.lock new file mode 100644 index 0000000..47c415a --- /dev/null +++ b/uv.lock @@ -0,0 +1,7 @@ +version = 1 +revision = 2 +requires-python = ">=3.8" + +[[package]] +name = "pycrc32" +source = { editable = "." } From 2f2ed86b1718ccf3528faa163340b9b839455670 Mon Sep 17 00:00:00 2001 From: Robin Date: Tue, 8 Jul 2025 18:58:19 +0200 Subject: [PATCH 2/3] Fix CI test-python-versions job by adding virtual environment setup --- .github/workflows/CI.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 28fc361..07a2243 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -257,6 +257,8 @@ jobs: - name: Build and test run: | uv tool install maturin + python -m venv .venv + source .venv/bin/activate maturin develop uv pip install pytest pytest From 44532e77cf77d473a370d53b3005f18c37d3a6c5 Mon Sep 17 00:00:00 2001 From: Robin Date: Tue, 8 Jul 2025 19:09:25 +0200 Subject: [PATCH 3/3] update supported python versions --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 15e3707..337e9ac 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # pycrc32 ![PyPI - Version](https://img.shields.io/pypi/v/pycrc32) -![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pycrc32) +![Python Version](https://img.shields.io/badge/python-3.8%20%7C%203.9%20%7C%203.10%20%7C%203.11%20%7C%203.12%20%7C%203.13-blue) ![PyPI - License](https://img.shields.io/pypi/l/pycrc32) ![PyPI - Downloads](https://img.shields.io/pypi/dm/pycrc32)