Skip to content

Commit

Permalink
stage some changes for leveraging tox-gh, remove experimental numba a…
Browse files Browse the repository at this point in the history
…nd llvmlite install steps
  • Loading branch information
Zeitsperre committed Apr 16, 2024
1 parent 4d5ed61 commit 4d93c48
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install tox
run: |
python -m pip install tox~=4.0
python -m pip install tox~=4.0 tox-gh flit
- name: Test with tox
run: |
python -m tox -e ${{ matrix.tox-env }} -- ${{ matrix.markers }}
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ dev = [
"tokenize-rt",
"tox >=4.0",
# "tox-conda", # Will be added when a [email protected]+ compatible plugin is released.
"tox-gh >=1.3.1",
"xdoctest",
"yamllint",
# Documentation and examples
Expand Down
24 changes: 15 additions & 9 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,23 @@ env_list =
notebooks
offline-prefetch
py39-upstream-doctest
py310
py310-doctest
py311-lmoments
py312-numba
py312-lmoments-doctest
labels =
test = py39, py310-upstream-doctest, py311, notebooks_doctests, offline-prefetch
requires =
pip >= 23.0
pip >= 23.3.0
flit
opts = -vv

[gh]
python =
3.12 = py312-coverage-lmoments-doctest
3.11 = py311-coverage-lmoments-sbck-doctest, offline-coverage-prefetch
3.10 = py310-coverage-lmoments-doctest, notebooks
3.9 = py39-coverage-sbck-doctest, lint, docs

[testenv:lint]
description = Run code quality compliance tests under {basepython}
skip_install = True
Expand Down Expand Up @@ -65,7 +73,7 @@ allowlist_externals =
;deps =
;extras =

[testenv:notebooks]
[testenv:notebooks{-prefetch,}]
description = Run notebooks with pytest under {basepython}
commands =
pytest --no-cov --nbval --dist=loadscope --rootdir=tests/ --ignore=docs/notebooks/example.ipynb docs/notebooks
Expand All @@ -74,7 +82,6 @@ commands_post =
[testenv:offline{-prefetch,}{-coverage,}]
description = Run tests with pytest under {basepython}, preventing socket connections (except for unix sockets for async support)
commands:
prefetch: xclim prefetch_testing_data
python -c 'print("Running offline tests with positional arguments: --disable-socket --allow-unix-socket --m \"not requires_internet\"")'
python -c 'print("These can be overwritten with: tox -e offline -- -m \"some other marker statement\"")'
pytest --disable-socket --allow-unix-socket {posargs:-m 'not requires_internet'}
Expand All @@ -99,14 +106,11 @@ passenv =
XCLIM_*
extras = dev
deps =
# FIXME: Remove when numba 0.59.0 is released
numba: numba==0.59.0rc1
numba: llvmlite==0.42.0rc1
coverage: coveralls
upstream: -rrequirements_upstream.txt
sbck: pybind11
lmoments: lmoments3
notebooks_doctests: lmoments3
notebooks: lmoments3
install_command = python -m pip install --no-user {opts} {packages}
download = True
commands_pre =
Expand All @@ -115,6 +119,7 @@ commands_pre =
xclim show_version_info
python -m pip check
xclim --help
prefetch: xclim prefetch_testing_data
commands =
prefetch: xclim prefetch_testing_data
pytest {posargs}
Expand All @@ -123,3 +128,4 @@ commands_post =
coverage: - coveralls
allowlist_externals =
git
xclim

0 comments on commit 4d93c48

Please sign in to comment.