diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b5dfeb2a..94babe39 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -20,27 +20,35 @@ 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 }} @@ -48,34 +56,44 @@ jobs: 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: diff --git a/pyproject.toml b/pyproject.toml index 34e48b5d..672643d3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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"]