diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c8e808495..a3dcba89c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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 }} diff --git a/pyproject.toml b/pyproject.toml index d5a61354d..c9c9fecb8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -83,6 +83,7 @@ dev = [ "tokenize-rt", "tox >=4.0", # "tox-conda", # Will be added when a tox@v4.0+ compatible plugin is released. + "tox-gh >=1.3.1", "xdoctest", "yamllint", # Documentation and examples diff --git a/tox.ini b/tox.ini index 78abbce02..75f76e574 100644 --- a/tox.ini +++ b/tox.ini @@ -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 @@ -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 @@ -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'} @@ -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 = @@ -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} @@ -123,3 +128,4 @@ commands_post = coverage: - coveralls allowlist_externals = git + xclim