Skip to content

Commit

Permalink
Use Pixi + fix test_run.py >3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
paugier committed Jan 16, 2024
1 parent 2f8d2f5 commit 1df0345
Show file tree
Hide file tree
Showing 9 changed files with 5,461 additions and 13 deletions.
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# GitHub syntax highlighting
pixi.lock linguist-language=YAML

21 changes: 10 additions & 11 deletions .github/workflows/ci-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,16 @@ jobs:

steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
- uses: prefix-dev/setup-pixi@v0.4.1
with:
environment-file: .github/environment-windows.yml
miniforge-variant: Mambaforge
miniforge-version: latest
activate-environment: test
use-mamba: true
- name: Install
run: |
python -m pip install --upgrade pip
pip install pdm nox
pixi-version: v0.11.1
cache: false
- name: Tests
run: |
nox -s test_without_pythran test_with_pythran
pixi run install-editable
pytest tests
mpirun -np 2 pytest tests
echo "TRANSONIC_BACKEND=python" >> $GITHUB_ENV
pytest tests
echo "TRANSONIC_BACKEND=numba" >> $GITHUB_ENV
pytest tests
18 changes: 18 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
stages:
- pixi
- image
- lint
- test
Expand All @@ -11,6 +12,18 @@ variables:

image: registry.heptapod.net:443/fluiddyn/transonic/ci/default:stable


pixi:test:
stage: pixi
image: registry.heptapod.net:443/fluiddyn/fluidsim/ci/default:pixi
script:
- pixi info
- pixi run install-editable
- pixi run pytest tests
- pixi run mpirun -np 2 pytest tests
- TRANSONIC_BACKEND=python pixi run pytest tests


# Build an image for the above tasks; this should be a scheduled job, as
# it is quite unnecessary to run on every invocation.
image:build:
Expand Down Expand Up @@ -45,6 +58,7 @@ image:build:
--destination registry.heptapod.net:443/fluiddyn/transonic/ci/$CI_COMMIT_HG_BRANCH:stable
# --destination registry.heptapod.net:443/fluiddyn/transonic/ci/default:stable
validate_code:
stage: lint
needs:
Expand All @@ -54,6 +68,7 @@ validate_code:
- pdm install -G dev
- pdm run make lint


step_without_pythran:
stage: test
needs:
Expand All @@ -78,6 +93,7 @@ step_pythran_cython:
script:
- nox -s test_with_pythran_cython


pages:
stage: publish
needs:
Expand All @@ -101,6 +117,7 @@ pages:
expire_in: 5 days
when: always


build:package:
stage: build
before_script:
Expand All @@ -120,6 +137,7 @@ build:package:
paths:
- ${PDM_CACHE_DIR}


# manually set PDM_PUBLISH_PASSWORD in web interface to your pypi API token
release:package:
stage: release
Expand Down
1 change: 1 addition & 0 deletions .hgignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ dist*
.tox
.coverage
.nox
.pixi

**/tmp*.py

Expand Down
2 changes: 1 addition & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def _install_base(session):

py_version = session.python if session.python is not None else sys.version.split(maxsplit=1)[0]
if version.parse(py_version) < version.parse("3.12"):
session.run_always("pip", "install", "numba")
session.install("numba")


@nox.session
Expand Down
Loading

0 comments on commit 1df0345

Please sign in to comment.