Skip to content

Commit e96853f

Browse files
update deps, switch to uv (#40)
* update deps, switch to uv * Fix CI test-python-versions job by adding virtual environment setup * update supported python versions
1 parent 659f3bc commit e96853f

File tree

7 files changed

+98
-52
lines changed

7 files changed

+98
-52
lines changed

.github/workflows/CI.yml

Lines changed: 53 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,12 @@ jobs:
5858
shell: bash
5959
run: |
6060
set -e
61+
curl -LsSf https://astral.sh/uv/install.sh | sh
62+
export PATH="$HOME/.local/bin:$PATH"
6163
python3 -m venv .venv
6264
source .venv/bin/activate
63-
pip install pycrc32 --find-links dist --force-reinstall
64-
pip install pytest
65+
uv pip install pycrc32 --find-links dist --force-reinstall
66+
uv pip install pytest
6567
pytest
6668
- name: pytest
6769
if: ${{ !startsWith(matrix.platform.target, 'x86') && matrix.platform.target != 'ppc64' }}
@@ -72,11 +74,14 @@ jobs:
7274
githubToken: ${{ github.token }}
7375
install: |
7476
apt-get update
75-
apt-get install -y --no-install-recommends python3 python3-pip
76-
pip3 install -U pip pytest
77+
apt-get install -y --no-install-recommends python3 python3-pip curl
78+
curl -LsSf https://astral.sh/uv/install.sh | sh
79+
export PATH="$HOME/.local/bin:$PATH"
80+
uv pip install --system pytest
7781
run: |
7882
set -e
79-
pip3 install pycrc32 --find-links dist --force-reinstall
83+
export PATH="$HOME/.local/bin:$PATH"
84+
uv pip install --system pycrc32 --find-links dist --force-reinstall
8085
pytest
8186
8287
musllinux:
@@ -117,11 +122,13 @@ jobs:
117122
options: -v ${{ github.workspace }}:/io -w /io
118123
run: |
119124
set -e
120-
apk add py3-pip py3-virtualenv
125+
apk add py3-pip py3-virtualenv curl
126+
curl -LsSf https://astral.sh/uv/install.sh | sh
127+
export PATH="$HOME/.local/bin:$PATH"
121128
python3 -m virtualenv .venv
122129
source .venv/bin/activate
123-
pip install pycrc32 --no-index --find-links dist --force-reinstall
124-
pip install pytest
130+
uv pip install pycrc32 --no-index --find-links dist --force-reinstall
131+
uv pip install pytest
125132
pytest
126133
- name: pytest
127134
if: ${{ !startsWith(matrix.platform.target, 'x86') }}
@@ -131,13 +138,15 @@ jobs:
131138
distro: alpine_latest
132139
githubToken: ${{ github.token }}
133140
install: |
134-
apk add py3-virtualenv
141+
apk add py3-virtualenv curl
142+
curl -LsSf https://astral.sh/uv/install.sh | sh
135143
run: |
136144
set -e
145+
export PATH="$HOME/.local/bin:$PATH"
137146
python3 -m virtualenv .venv
138147
source .venv/bin/activate
139-
pip install pytest
140-
pip install pycrc32 --find-links dist --force-reinstall
148+
uv pip install pytest
149+
uv pip install pycrc32 --find-links dist --force-reinstall
141150
pytest
142151
143152
windows:
@@ -171,10 +180,12 @@ jobs:
171180
shell: bash
172181
run: |
173182
set -e
183+
curl -LsSf https://astral.sh/uv/install.sh | sh
184+
export PATH="$HOME/.local/bin:$PATH"
174185
python3 -m venv .venv
175186
source .venv/Scripts/activate
176-
pip install pycrc32 --find-links dist --force-reinstall
177-
pip install pytest
187+
uv pip install pycrc32 --find-links dist --force-reinstall
188+
uv pip install pytest
178189
pytest
179190
180191
macos:
@@ -205,10 +216,12 @@ jobs:
205216
- name: pytest
206217
run: |
207218
set -e
219+
curl -LsSf https://astral.sh/uv/install.sh | sh
220+
export PATH="$HOME/.local/bin:$PATH"
208221
python3 -m venv .venv
209222
source .venv/bin/activate
210-
pip install pycrc32 --find-links dist --force-reinstall
211-
pip install pytest
223+
uv pip install pycrc32 --find-links dist --force-reinstall
224+
uv pip install pytest
212225
pytest
213226
214227
sdist:
@@ -226,11 +239,35 @@ jobs:
226239
name: wheels-sdist
227240
path: dist
228241

242+
test-python-versions:
243+
name: Test Python versions
244+
runs-on: ubuntu-latest
245+
strategy:
246+
matrix:
247+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
248+
steps:
249+
- uses: actions/checkout@v4
250+
- uses: actions/setup-python@v5
251+
with:
252+
python-version: ${{ matrix.python-version }}
253+
- name: Install uv
254+
run: |
255+
curl -LsSf https://astral.sh/uv/install.sh | sh
256+
echo "$HOME/.local/bin" >> $GITHUB_PATH
257+
- name: Build and test
258+
run: |
259+
uv tool install maturin
260+
python -m venv .venv
261+
source .venv/bin/activate
262+
maturin develop
263+
uv pip install pytest
264+
pytest
265+
229266
release:
230267
name: Release
231268
runs-on: ubuntu-latest
232269
if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
233-
needs: [linux, musllinux, windows, macos, sdist]
270+
needs: [linux, musllinux, windows, macos, sdist, test-python-versions]
234271
permissions:
235272
# Use to sign the release artifacts
236273
id-token: write

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,6 @@ docs/_build/
7070

7171
# Pyenv
7272
.python-version
73+
74+
CLAUDE.md
75+
GEMINI.md

Cargo.lock

Lines changed: 32 additions & 33 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ crate-type = ["cdylib"]
1616

1717
[dependencies]
1818
crc32fast = "1.4.2"
19-
pyo3 = "0.24.0"
19+
pyo3 = "0.25.1"
2020

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# pycrc32
22
![PyPI - Version](https://img.shields.io/pypi/v/pycrc32)
3-
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pycrc32)
3+
![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)
44
![PyPI - License](https://img.shields.io/pypi/l/pycrc32)
55
![PyPI - Downloads](https://img.shields.io/pypi/dm/pycrc32)
66

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Homepage = "https://github.com/code-inflation/pycrc32"
3636
Repository = "https://github.com/code-inflation/pycrc32"
3737

3838
[build-system]
39-
requires = ["maturin>=1.4,<2.0"]
39+
requires = ["maturin>=1.9,<2.0"]
4040
build-backend = "maturin"
4141

4242
[tool.maturin]

uv.lock

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)