Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 25 additions & 7 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,62 +20,80 @@ jobs:
arch: [x64] # x86 unsupported by MicroMamba
os: [ubuntu-latest, windows-latest, macos-latest]
jlversion: ['1','1.9']

steps:
- uses: actions/checkout@v4

- name: Set up Julia ${{ matrix.jlversion }}
uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.jlversion }}
arch: ${{ matrix.arch }}

- uses: julia-actions/cache@v2

- name: Build package
uses: julia-actions/julia-buildpkg@v1

- name: Run tests
uses: julia-actions/julia-runtest@v1
env:
JULIA_DEBUG: PythonCall
JULIA_NUM_THREADS: '2'

- name: Process coverage
uses: julia-actions/julia-processcoverage@v1

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

python:
name: Test (${{ matrix.os }}, python ${{ matrix.pyversion }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
pyversion: ["3.x", "3.8"]
pyversion: [">=3.8", "3.8"]

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.pyversion }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.pyversion }}

- name: Set up uv
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.pyversion }}

- name: Set up Julia
uses: julia-actions/setup-julia@v2
with:
version: '1'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest pytest-cov nbval numpy
cp pysrc/juliacall/juliapkg-dev.json pysrc/juliacall/juliapkg.json
pip install -e .
uv sync --dev

- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --ignore=F821 --show-source --statistics
uv run flake8 ./pysrc ./pytest --count --select=E9,F63,F7,F82 --ignore=F821 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
uv run flake8 ./pysrc ./pytest --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics

- name: Run tests
run: |
pytest -s --nbval --cov=pysrc ./pytest/
uv run pytest -s --nbval --cov=pysrc ./pytest/
env:
PYTHON_JULIACALL_THREADS: '2'

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
env:
Expand Down
13 changes: 11 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,17 @@ classifiers = [
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
]
requires-python = ">=3.8"
dependencies = ["juliapkg ~=0.1.17"]
requires-python = ">=3.8, <4"
dependencies = ["juliapkg >=0.1.17, <0.2"]

[dependency-groups]
dev = [
"flake8>=5.0",
"nbval>=0.11.0",
"numpy>=1.24",
"pytest>=8.3",
"pytest-cov>=5.0",
]

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