-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #52 from ocefpaf/fix_cis
Use pixi for CIs
- Loading branch information
Showing
8 changed files
with
16,800 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# GitHub syntax highlighting | ||
pixi.lock linguist-language=YAML linguist-generated=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,41 +10,18 @@ on: | |
- published | ||
|
||
jobs: | ||
build-docs: | ||
run: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v4 | ||
- uses: actions/checkout@v4 | ||
- name: Setup Pixi | ||
uses: prefix-dev/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
manifest-path: pyproject.toml | ||
|
||
- name: Setup Micromamba | ||
uses: mamba-org/setup-micromamba@v1 | ||
with: | ||
environment-name: TEST | ||
init-shell: bash | ||
create-args: >- | ||
python=3 pip | ||
--file requirements.txt | ||
--file requirements-dev.txt | ||
--channel conda-forge | ||
- name: Install ciso | ||
shell: bash -l {0} | ||
run: | | ||
python -m pip install -e . --no-deps --force-reinstall | ||
- name: Build documentation | ||
shell: bash -l {0} | ||
run: | | ||
set -e | ||
jupyter nbconvert --to notebook --execute notebooks/ciso_unstructure.ipynb --output=ciso_unstructure-output.ipynb | ||
jupyter nbconvert --to notebook --execute notebooks/ciso_c_grid.ipynb --output=ciso_c_grid-output.ipynb | ||
mv notebooks/*output.ipynb docs/source/ | ||
pushd docs | ||
make clean html linkcheck | ||
popd | ||
- name: Run Tests | ||
run: pixi run --environment py312 docs | ||
|
||
- name: Deploy | ||
if: success() && github.event_name == 'release' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,48 +3,28 @@ name: Tests | |
on: | ||
pull_request: | ||
push: | ||
branches: [main] | ||
branches: | ||
- main | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
run: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
python-version: ["3.9", "3.10", "3.11", "3.12"] | ||
os: [windows-latest, ubuntu-latest, macos-latest] | ||
experimental: [false] | ||
include: | ||
- python-version: "3.12" | ||
os: "ubuntu-latest" | ||
experimental: true | ||
pixi-environment: [ py310, py311, py312 ] | ||
os: [ windows-latest, ubuntu-latest, macos-latest ] | ||
fail-fast: false | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup Micromamba ${{ matrix.python-version }} | ||
uses: mamba-org/setup-micromamba@v1 | ||
- name: Setup Pixi | ||
uses: prefix-dev/[email protected] | ||
with: | ||
environment-name: TEST | ||
init-shell: bash | ||
create-args: >- | ||
python=${{ matrix.python-version }} pip | ||
--file requirements.txt | ||
--file requirements-dev.txt | ||
--channel conda-forge | ||
- name: Install unstable dependencies | ||
if: matrix.experimental == true | ||
run: | | ||
micromamba install conda-forge/label/numpy_dev::numpy | ||
- name: Install ciso | ||
run: | | ||
python -m pip install -e . --no-deps --force-reinstall | ||
manifest-path: pyproject.toml | ||
|
||
- name: Tests | ||
run: | | ||
python -m pytest -rxs ciso/tests | ||
- name: Run Tests | ||
run: pixi run --environment ${{ matrix.pixi-environment }} test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,6 @@ _ciso*.so | |
build/ | ||
ciso/_version.py | ||
dist/ | ||
# pixi environments | ||
.pixi | ||
*.egg-info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,8 +3,7 @@ requires = [ | |
"setuptools>=41.2", | ||
"setuptools-scm", | ||
"cython>=3", | ||
"oldest-supported-numpy ; python_version < '3.9'", | ||
"numpy>=2.0.0rc1 ; python_version >= '3.9'", | ||
"numpy>=2", | ||
"wheel", | ||
] | ||
build-backend = "setuptools.build_meta" | ||
|
@@ -18,11 +17,10 @@ authors = [ | |
{email = "[email protected]"}, | ||
{name = "Robert Hetland"} | ||
] | ||
requires-python = ">=3.9" | ||
requires-python = ">=3.10" | ||
license = {text = "BSD-2-Clause"} | ||
dependencies = [ | ||
"oldest-supported-numpy ; python_version < '3.9'", | ||
"numpy>=2.0.0rc1 ; python_version >= '3.9'", | ||
"numpy", | ||
] | ||
|
||
[project.optional-dependencies] | ||
|
@@ -79,3 +77,48 @@ exclude = ["setup.py", "docs", "tests"] | |
verbose = 1 | ||
quiet = false | ||
color = true | ||
|
||
[tool.pixi.project] | ||
channels = ["conda-forge"] | ||
platforms = ["win-64", "linux-64", "osx-64"] | ||
|
||
[tool.pixi.environments] | ||
default = { features = ["py312"], solve-group = "py312" } | ||
py312 = { features = ["py312"], solve-group = "py312" } | ||
py311 = ["py311"] | ||
py310 = ["py310"] | ||
|
||
[tool.pixi.tasks] | ||
install-pre-commit = "pre-commit install" | ||
pre-commit = "pre-commit run --all-files" | ||
test = "pip install -e . --no-deps --force-reinstall && pytest -rxs ciso/tests" | ||
docs = """\ | ||
pip install -e . --no-deps --force-reinstall | ||
&& jupyter nbconvert --to notebook --execute notebooks/ciso_unstructure.ipynb --output=ciso_unstructure-output.ipynb | ||
&& jupyter nbconvert --to notebook --execute notebooks/ciso_c_grid.ipynb --output=ciso_c_grid-output.ipynb | ||
&& mv notebooks/*output.ipynb docs/source/ | ||
&& cd docs | ||
&& make clean html linkcheck | ||
""" | ||
|
||
[tool.pixi.feature.py312.dependencies] | ||
python = "3.12.*" | ||
|
||
[tool.pixi.feature.py311.dependencies] | ||
python = "3.11.*" | ||
|
||
[tool.pixi.feature.py310.dependencies] | ||
python = "3.10.*" | ||
|
||
[tool.pixi.dependencies] | ||
cython = ">=3.0.11,<4" | ||
numpy = ">1.19" | ||
pytest = ">=8.3.3,<9" | ||
pre-commit = ">=3.8.0,<4" | ||
gridgeo = ">=1.5.2,<2" | ||
jupyter = ">=1.1.1,<2" | ||
nbsphinx = ">=0.9.5,<0.10" | ||
sphinx = ">=8.0.2,<9" | ||
pip = ">=24.2,<25" | ||
scitools-iris = ">=3.9.0,<4" | ||
nbclassic = ">=1.1.0,<2" |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.