diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7653407a5..d7d402cbc 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,7 +20,7 @@ on: - submitted env: - MAIN_TESTDATA_BRANCH: main + XCLIM_TESTDATA_BRANCH: main jobs: black: @@ -115,8 +115,9 @@ jobs: python -m pip install --no-user . - name: Test run: | + pip list pip check - pytest xclim --durations=10 + pytest xclim --num-workers=logical --durations=10 --cov=xclim --cov-report=term-missing env: CONDA_EXE: mamba GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -184,10 +185,6 @@ jobs: run: pylint --rcfile=pylintrc --disable=import-error --exit-zero xclim - name: Test with tox run: tox -e notebooks_doctests - - name: Report coverage - run: | - pip install --upgrade coveralls - coveralls env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} COVERALLS_FLAG_NAME: run-notebooks_doctests-py38 diff --git a/pyproject.toml b/pyproject.toml index 5d9f9cae8..c1bdfa15a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -166,10 +166,8 @@ ignore_missing_imports = true addopts = [ "--verbose", "--color=yes", - "--cov=xclim", - "--cov-report=term-missing", - "--numprocesses=auto", - "--maxprocesses=6", + "--numprocesses=0", + "--maxprocesses=8", "--dist=worksteal" ] norecursedirs = ["docs/notebooks/*"] diff --git a/tox.ini b/tox.ini index ce348df9c..d5e8df350 100644 --- a/tox.ini +++ b/tox.ini @@ -1,16 +1,15 @@ [tox] +min_version = 4.0 env_list = black docs - notebooks_doctests + notebooks_doctests{-coverage,} ; opt-slow py38-lm3 py39-upstream-doctest py310-slow -isolated_build = True requires = pip >= 21.0 - tox ~=3.0 opts = -v [testenv:black] @@ -35,6 +34,7 @@ commands = blackdoc --check docs isort --check xclim yamllint --config-file=.yamllint.yaml xclim +commands_post = [testenv:docs] description = Build the documentation with makefile under {basepython} @@ -44,6 +44,7 @@ setenv = READTHEDOCS = 1 commands = make docs +commands_post = allowlist_externals = env make @@ -55,11 +56,11 @@ allowlist_externals = ;conda_env = environment-dev.yml ;extras = -[testenv:notebooks_doctests] +[testenv:notebooks_doctests{-coverage,}] description = Run notebooks and doctests with pytest under {basepython} commands = - pytest --no-cov --nbval --dist=loadscope docs/notebooks --durations=10 --ignore=docs/notebooks/example.ipynb - pytest --rootdir xclim/testing/tests/ --xdoctest xclim --ignore=xclim/testing/tests/ --durations=10 + pytest --no-cov --nbval --dist=loadscope docs/notebooks --ignore=docs/notebooks/example.ipynb + pytest --rootdir xclim/testing/tests/ --xdoctest xclim --ignore=xclim/testing/tests/ # Requires tox-conda compatible with tox@v4.0 ;[testenv:opt-{slow,not_slow}] @@ -76,6 +77,8 @@ commands = description = Run tests with pytest under {basepython} setenv = COV_CORE_SOURCE = + PYTEST_ADDOPTS = --numprocesses=logical --durations=10 + coverage: PYTEST_ADDOPTS = --numprocesses=logical --durations=10 --cov=xclim --cov-report=term-missing PYTHONPATH = {toxinidir} passenv = CI @@ -83,7 +86,7 @@ passenv = COVERALLS_* GITHUB_* LD_LIBRARY_PATH - MAIN_TESTDATA_BRANCH + XCLIM_* extras = dev deps = coverage: coveralls @@ -91,12 +94,14 @@ deps = upstream: -rrequirements_upstream.txt install_command = python -m pip install --no-user {opts} {packages} download = True -commands = +commands_pre = pip list pip check - doctest: pytest --no-cov --rootdir xclim/testing/tests/ --xdoctest xclim --ignore=xclim/testing/tests/ --durations=10 - !slow: pytest xclim -m "not slow" --durations=10 - slow: pytest xclim --durations=10 +commands = + doctest: pytest --no-cov --rootdir xclim/testing/tests/ --xdoctest xclim --ignore=xclim/testing/tests/ + !slow: pytest xclim -m "not slow" + slow: pytest xclim +commands_post = coverage: - coveralls allowlist_externals = git