Skip to content

Commit

Permalink
Use Transonic 0.6.0 + better Github Actions Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
paugier committed Jan 16, 2024
1 parent 3ad0271 commit 223962f
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 16 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/ci-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,12 @@ jobs:
run: |
cp .github/workflows/.fluidfft-site.cfg $HOME
nox -s test_without_fft_and_pythran
mv .coverage/coverage.xml coverage_without_fft_and_pythran.xml
nox -s test_with_fft_and_pythran
mv .coverage/coverage.xml coverage_with_fft_and_pythran.xml
- uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true # optional (default = false)
fail_ci_if_error: false # optional (default = false)
verbose: true # optional (default = false)
files: coverage_without_fft_and_pythran.xml,coverage_with_fft_and_pythran.xml
26 changes: 19 additions & 7 deletions noxfile.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import os
from pathlib import Path
from shutil import rmtree

import nox

Expand All @@ -14,19 +16,29 @@ def validate_code(session):
session.run("pdm", "validate_code", external=True)


def _test(session, env=None):
path_coverage = Path(".coverage")
rmtree(path_coverage, ignore_errors=True)
path_coverage.mkdir(exist_ok=True)

if env is not None:
print(env)

session.run("make", "_tests_coverage", external=True, env=env)
session.run("coverage", "combine")
session.run("coverage", "report")
session.run("coverage", "xml")


@nox.session
def test_without_fft_and_pythran(session):
command = "pdm sync --clean -G dev -G test -G mpi --no-self"
session.run_always(*command.split(), external=True)
session.install(
".", "--config-settings=setup-args=-Dtransonic-backend=python", "--no-deps"
)
session.run(
"make",
"_tests_coverage",
external=True,
env={"TRANSONIC_BACKEND": "python", "TRANSONIC_NO_REPLACE": "1"},
)

_test(session, env={"TRANSONIC_BACKEND": "python", "TRANSONIC_NO_REPLACE": "1"})


@nox.session
Expand All @@ -38,4 +50,4 @@ def test_with_fft_and_pythran(session):
session.run_always(*command.split(), external=True)
session.install(".", "--no-deps", "-C", "setup-args=-Dnative=true")

session.run("make", "_tests_coverage", external=True)
_test(session)
8 changes: 4 additions & 4 deletions pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ platforms = ["linux-64"]
[tasks]
# use as `pixi run install-editable`
# install-dependencies = "pixi install && pip install -e ./lib && pip install ../transonic"
install-dependencies = "pixi install && pip install -e ./lib && pip install transonic==0.6.0rc0"
install-dependencies = "pixi install && pip install -e ./lib && pip install 'transonic>=0.6.0'"
install-editable = {cmd = "pip install -e . -v --no-build-isolation --no-deps", depends_on = ["install-dependencies"]}

[dependencies]
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = [
"meson-python",
"numpy",
# "transonic@hg+https://foss.heptapod.net/fluiddyn/transonic",
"transonic>=0.6.0rc0",
"transonic>=0.6.0",
"pythran>=0.9.7",
]
build-backend = 'mesonpy'
Expand All @@ -24,7 +24,7 @@ dependencies = [
"fluidsim-core>=0.7.4",
"h5py",
"h5netcdf",
"transonic>=0.6.0rc0",
"transonic>=0.6.0",
"xarray",
"rich",
"matplotlib>=3.3",
Expand Down Expand Up @@ -140,7 +140,7 @@ build = [
"meson-python",
"numpy",
# "transonic@hg+https://foss.heptapod.net/fluiddyn/transonic@default",
"transonic>=0.6.0rc0",
"transonic>=0.6.0",
"pythran>=0.9.7",
"ninja",
]
Expand Down

0 comments on commit 223962f

Please sign in to comment.