Skip to content

Commit 0397cd9

Browse files
committed
fixes
1 parent a5b7cbf commit 0397cd9

File tree

4 files changed

+164
-68
lines changed

4 files changed

+164
-68
lines changed

.github/workflows/python_lint.yml

Lines changed: 47 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -5,79 +5,83 @@ on: [push, pull_request]
55

66
jobs:
77
mypy_lint:
8-
name: mypy lint
9-
runs-on: ubuntu-latest
8+
name: mypy
9+
runs-on: ubuntu-22.04
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
py_version:
14+
- '3.8'
15+
1016
steps:
11-
- name: Checkout repository
17+
- name: Checkout reposistory
1218
uses: actions/checkout@main
1319

14-
- name: Set up Python 3.9
20+
- name: Set up Python ${{ matrix.py_version }}
1521
uses: actions/setup-python@main
1622
with:
17-
python-version: 3.9
23+
python-version: ${{ matrix.py_version }}
1824

19-
- name: Setup venv
20-
run: |
21-
python3 -m venv .venv
25+
- name: Install uv
26+
uses: astral-sh/setup-uv@v7
2227

23-
- name: Install dependencies
28+
# Setup venv and install dependencies without building the project from source.
29+
- name: Install Dependencies
2430
run: |
25-
. .venv/bin/activate
26-
python3 -m pip install -U mypy
31+
uv venv --no-project --python ${{ matrix.py_version }}
32+
uv sync --no-install-project
33+
uv pip install -U mypy
2734
2835
- name: mypy
2936
run: |
30-
. .venv/bin/activate
31-
python3 -m mypy --show-column-numbers --hide-error-context .
37+
uv run --no-sync mypy --show-column-numbers --hide-error-context .
38+
39+
ruff:
40+
name: ruff
41+
runs-on: ubuntu-22.04
42+
strategy:
43+
fail-fast: false
44+
matrix:
45+
py_version:
46+
- '3.8'
3247

33-
ruff_lint:
34-
name: ruff lint
35-
runs-on: ubuntu-latest
3648
steps:
3749
- name: Checkout repository
3850
uses: actions/checkout@main
3951

40-
- name: Set up Python 3.9
52+
- name: Set up Python ${{ matrix.py_version }}
4153
uses: actions/setup-python@main
4254
with:
43-
python-version: 3.9
55+
python-version: ${{ matrix.py_version }}
4456

45-
- name: Setup venv
46-
run: |
47-
python3 -m venv .venv
57+
- name: Install uv
58+
uses: astral-sh/setup-uv@v7
4859

49-
- name: Install dependencies
60+
- name: ruff
5061
run: |
51-
. .venv/bin/activate
52-
python3 -m pip install -U ruff
53-
54-
- name: mypy
55-
run: |
56-
. .venv/bin/activate
57-
ruff check src/
62+
uvx ruff check src/
5863
5964
ruff_format:
6065
name: ruff format
61-
runs-on: ubuntu-latest
66+
runs-on: ubuntu-22.04
67+
strategy:
68+
fail-fast: false
69+
matrix:
70+
py_version:
71+
- '3.8'
72+
6273
steps:
6374
- name: Checkout repository
6475
uses: actions/checkout@main
6576

66-
- name: Set up Python 3.9
77+
- name: Set up Python ${{ matrix.py_version }}
6778
uses: actions/setup-python@main
6879
with:
69-
python-version: 3.9
70-
71-
- name: Setup venv
72-
run: |
73-
python3 -m venv .venv
80+
python-version: ${{ matrix.py_version }}
7481

75-
- name: Install dependencies
76-
run: |
77-
. .venv/bin/activate
78-
python3 -m pip install -U ruff
82+
- name: Install uv
83+
uses: astral-sh/setup-uv@v7
7984

80-
- name: mypy
85+
- name: ruff
8186
run: |
82-
. .venv/bin/activate
83-
ruff format src/ --check
87+
uvx ruff format src/ --check

.github/workflows/test_other_repo_python.yml

Lines changed: 76 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,51 @@ on: [push, pull_request]
55

66
jobs:
77
test_other_repo_py_script:
8-
name: Test other repo (Python script)
9-
runs-on: ubuntu-latest
10-
8+
name: Test other repo (Python ${{ matrix.py_version }})
9+
runs-on: ubuntu-22.04
1110
strategy:
1211
fail-fast: false
12+
matrix:
13+
py_version:
14+
- '3.7'
15+
- '3.8'
16+
- '3.9'
17+
- '3.10'
18+
- '3.11'
19+
- '3.12'
20+
- '3.13'
21+
- '3.14'
22+
- '3.14t'
23+
- '3.x' # Explicit latest
1324

1425
steps:
1526
- name: Checkout repository
1627
uses: actions/checkout@main
1728

18-
- name: Install Dependencies
29+
- name: Setup Rust toolchain
30+
uses: dtolnay/rust-toolchain@stable
31+
32+
- name: Set up Python ${{ matrix.py_version }}
33+
uses: actions/setup-python@main
34+
with:
35+
python-version: ${{ matrix.py_version }}
36+
37+
- name: Install uv
38+
uses: astral-sh/setup-uv@v7
39+
40+
- name: Setup venv ${{ matrix.py_version }}
41+
if: ${{ matrix.py_version != '3.x' }}
42+
run: |
43+
uv venv --python ${{ matrix.py_version }}
44+
# `--python 3 --managed-python` makes uv to install the latest python version available
45+
- name: Setup venv 3.x
46+
if: ${{ matrix.py_version == '3.x' }}
1947
run: |
20-
python3 -m pip install -U maturin
48+
uv venv --python 3 --managed-python
2149
22-
- name: Install local ipl3checksum
23-
run: python3 -m pip install .
50+
- name: Sync venv
51+
run: |
52+
uv sync
2453
2554
- name: Get extra dependencies
2655
uses: actions/checkout@main
@@ -30,25 +59,54 @@ jobs:
3059
path: deps_repo
3160

3261
- name: Run repo tests
33-
run: python3 tests/check_recursive.py deps_repo
62+
run: uv run tests/check_recursive.py deps_repo
3463

3564
test_other_repo_py_cli:
36-
name: Test other repo (Python cli)
37-
runs-on: ubuntu-latest
38-
65+
name: Test other rep (Python ${{ matrix.py_version }})
66+
runs-on: ubuntu-22.04
3967
strategy:
4068
fail-fast: false
69+
matrix:
70+
py_version:
71+
- '3.7'
72+
- '3.8'
73+
- '3.9'
74+
- '3.10'
75+
- '3.11'
76+
- '3.12'
77+
- '3.13'
78+
- '3.14'
79+
- '3.14t'
80+
- '3.x' # Explicit latest
4181

4282
steps:
4383
- name: Checkout repository
4484
uses: actions/checkout@main
4585

46-
- name: Install Dependencies
86+
- name: Setup Rust toolchain
87+
uses: dtolnay/rust-toolchain@stable
88+
89+
- name: Set up Python ${{ matrix.py_version }}
90+
uses: actions/setup-python@main
91+
with:
92+
python-version: ${{ matrix.py_version }}
93+
94+
- name: Install uv
95+
uses: astral-sh/setup-uv@v7
96+
97+
- name: Setup venv ${{ matrix.py_version }}
98+
if: ${{ matrix.py_version != '3.x' }}
4799
run: |
48-
python3 -m pip install -U maturin
100+
uv venv --python ${{ matrix.py_version }}
101+
# `--python 3 --managed-python` makes uv to install the latest python version available
102+
- name: Setup venv 3.x
103+
if: ${{ matrix.py_version == '3.x' }}
104+
run: |
105+
uv venv --python 3 --managed-python
49106
50-
- name: Install local ipl3checksum
51-
run: python3 -m pip install .
107+
- name: Sync venv
108+
run: |
109+
uv sync
52110
53111
- name: Get extra dependencies
54112
uses: actions/checkout@main
@@ -58,4 +116,6 @@ jobs:
58116
path: deps_repo
59117

60118
- name: Run repo tests
61-
run: bindings/python/tests/test_check_other_repo.sh
119+
run: |
120+
. .venv/bin/activate
121+
bindings/python/tests/test_check_other_repo.sh

.github/workflows/tests.yml

Lines changed: 40 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,54 @@ on: [push, pull_request]
55

66
jobs:
77
tests_cases:
8-
name: Tests cases
9-
runs-on: ubuntu-latest
8+
name: Tests cases (Python ${{ matrix.py_version }})
9+
runs-on: ubuntu-22.04
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
py_version:
14+
- '3.7'
15+
- '3.8'
16+
- '3.9'
17+
- '3.10'
18+
- '3.11'
19+
- '3.12'
20+
- '3.13'
21+
- '3.14'
22+
- '3.14t'
23+
- '3.x' # Explicit latest
1024

1125
steps:
1226
- name: Checkout repository
1327
uses: actions/checkout@main
1428

15-
- name: Install Dependencies
29+
- name: Setup Rust toolchain
30+
uses: dtolnay/rust-toolchain@stable
31+
32+
- name: Set up Python ${{ matrix.py_version }}
33+
uses: actions/setup-python@main
34+
with:
35+
python-version: ${{ matrix.py_version }}
36+
37+
- name: Install uv
38+
uses: astral-sh/setup-uv@v7
39+
40+
- name: Setup venv ${{ matrix.py_version }}
41+
if: ${{ matrix.py_version != '3.x' }}
1642
run: |
17-
pip3 install -U maturin
43+
uv venv --python ${{ matrix.py_version }}
44+
# `--python 3 --managed-python` makes uv to install the latest python version available
45+
- name: Setup venv 3.x
46+
if: ${{ matrix.py_version == '3.x' }}
47+
run: |
48+
uv venv --python 3 --managed-python
1849
19-
- name: Install local ipl3checksum
20-
run: pip install .
50+
- name: Sync venv
51+
run: |
52+
uv sync
2153
2254
- name: Update tests outputs
23-
run: python3 tests/check_correct_sum.py
55+
run: uv run tests/check_correct_sum.py
2456

2557
- name: Test exceptions
26-
run: python3 tests/exception_test.py
58+
run: uv run tests/exception_test.py

src/rs/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ mod python_bindings {
2424

2525
use super::*;
2626

27-
#[pymodule(gil_uesd = false)]
27+
#[pymodule(gil_used = false)]
2828
fn ipl3checksum(m: &Bound<'_, PyModule>) -> PyResult<()> {
2929
// Classes
3030
m.add_class::<cickinds::CICKind>()?;

0 commit comments

Comments
 (0)