Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use uv and hatchling #552

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
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
Prev Previous commit
Next Next commit
use UV in CI
Christopher Doris committed Sep 6, 2024
commit 3255bc9ee702124d42da9da35100fb1d33c27a1c
28 changes: 23 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -20,13 +20,16 @@ jobs:
arch: [x64] # x86 unsupported by MicroMamba
os: [ubuntu-latest, windows-latest, macos-latest]
jlversion: ['1','1.6']

steps:
- uses: actions/checkout@v2

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

- uses: actions/cache@v1
env:
cache-name: cache-artifacts
@@ -37,19 +40,24 @@ jobs:
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- 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@v2
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

python:
name: Test (${{ matrix.os }}, python ${{ matrix.pyversion }})
runs-on: ${{ matrix.os }}
@@ -58,33 +66,43 @@ jobs:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
pyversion: ["3.x", "3.8"]

steps:
- uses: actions/checkout@v3

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

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

- name: Set up UV
uses: astral-sh/setup-uv@v2

- 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
uv sync
uv pip install numpy # todo: move into dev-dependencies
pip install -e .
- 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 . --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 . --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@v2
env: