Skip to content

Commit 8b8ac73

Browse files
authored
use uv more (#621)
* use uv more * fix python version * fix source folder to be linted --------- Co-authored-by: Christopher Doris <github.com/cjdoris>
1 parent 0a7d49f commit 8b8ac73

File tree

2 files changed

+36
-9
lines changed

2 files changed

+36
-9
lines changed

.github/workflows/tests.yml

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,62 +20,80 @@ jobs:
2020
arch: [x64] # x86 unsupported by MicroMamba
2121
os: [ubuntu-latest, windows-latest, macos-latest]
2222
jlversion: ['1','1.9']
23+
2324
steps:
2425
- uses: actions/checkout@v4
26+
2527
- name: Set up Julia ${{ matrix.jlversion }}
2628
uses: julia-actions/setup-julia@v2
2729
with:
2830
version: ${{ matrix.jlversion }}
2931
arch: ${{ matrix.arch }}
32+
3033
- uses: julia-actions/cache@v2
34+
3135
- name: Build package
3236
uses: julia-actions/julia-buildpkg@v1
37+
3338
- name: Run tests
3439
uses: julia-actions/julia-runtest@v1
3540
env:
3641
JULIA_DEBUG: PythonCall
3742
JULIA_NUM_THREADS: '2'
43+
3844
- name: Process coverage
3945
uses: julia-actions/julia-processcoverage@v1
46+
4047
- name: Upload coverage to Codecov
4148
uses: codecov/codecov-action@v5
4249
env:
4350
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
51+
4452
python:
4553
name: Test (${{ matrix.os }}, python ${{ matrix.pyversion }})
4654
runs-on: ${{ matrix.os }}
4755
strategy:
4856
fail-fast: true
4957
matrix:
5058
os: [ubuntu-latest, windows-latest, macos-latest]
51-
pyversion: ["3.x", "3.8"]
59+
pyversion: [">=3.8", "3.8"]
60+
5261
steps:
5362
- uses: actions/checkout@v4
63+
5464
- name: Set up Python ${{ matrix.pyversion }}
5565
uses: actions/setup-python@v5
5666
with:
5767
python-version: ${{ matrix.pyversion }}
68+
69+
- name: Set up uv
70+
uses: astral-sh/setup-uv@v5
71+
with:
72+
python-version: ${{ matrix.pyversion }}
73+
5874
- name: Set up Julia
5975
uses: julia-actions/setup-julia@v2
6076
with:
6177
version: '1'
78+
6279
- name: Install dependencies
6380
run: |
64-
python -m pip install --upgrade pip
65-
pip install flake8 pytest pytest-cov nbval numpy
6681
cp pysrc/juliacall/juliapkg-dev.json pysrc/juliacall/juliapkg.json
67-
pip install -e .
82+
uv sync --dev
83+
6884
- name: Lint with flake8
6985
run: |
7086
# stop the build if there are Python syntax errors or undefined names
71-
flake8 . --count --select=E9,F63,F7,F82 --ignore=F821 --show-source --statistics
87+
uv run flake8 ./pysrc ./pytest --count --select=E9,F63,F7,F82 --ignore=F821 --show-source --statistics
7288
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
73-
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
89+
uv run flake8 ./pysrc ./pytest --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
90+
7491
- name: Run tests
7592
run: |
76-
pytest -s --nbval --cov=pysrc ./pytest/
93+
uv run pytest -s --nbval --cov=pysrc ./pytest/
7794
env:
7895
PYTHON_JULIACALL_THREADS: '2'
96+
7997
- name: Upload coverage to Codecov
8098
uses: codecov/codecov-action@v5
8199
env:

pyproject.toml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,17 @@ classifiers = [
1212
"License :: OSI Approved :: MIT License",
1313
"Operating System :: OS Independent",
1414
]
15-
requires-python = ">=3.8"
16-
dependencies = ["juliapkg ~=0.1.17"]
15+
requires-python = ">=3.8, <4"
16+
dependencies = ["juliapkg >=0.1.17, <0.2"]
17+
18+
[dependency-groups]
19+
dev = [
20+
"flake8>=5.0",
21+
"nbval>=0.11.0",
22+
"numpy>=1.24",
23+
"pytest>=8.3",
24+
"pytest-cov>=5.0",
25+
]
1726

1827
[tool.hatch.build.targets.wheel]
1928
packages = ["pysrc/juliacall"]

0 commit comments

Comments
 (0)