|
| 1 | +[tox] |
| 2 | +requires = |
| 3 | + tox>=4 |
| 4 | + tox-uv |
| 5 | +envlist = |
| 6 | + py3{9,10,11,12,13}-latest |
| 7 | + py39-min |
| 8 | + py3{11,12,13}-pre |
| 9 | + style |
| 10 | + spellcheck |
| 11 | +skip_missing_interpreters = true |
| 12 | + |
| 13 | +# Configuration that allows us to split tests across GitHub runners effectively |
| 14 | +[gh-actions] |
| 15 | +python = |
| 16 | + 3.9: py39 |
| 17 | + 3.10: py310 |
| 18 | + 3.11: py311 |
| 19 | + 3.12: py312 |
| 20 | + 3.13: py313 |
| 21 | + |
| 22 | +[gh-actions:env] |
| 23 | +DEPENDS = |
| 24 | + min: min |
| 25 | + latest: latest |
| 26 | + pre: pre |
| 27 | + |
| 28 | +[testenv] |
| 29 | +description = Pytest with coverage |
| 30 | +labels = test |
| 31 | +pip_pre = |
| 32 | + pre: true |
| 33 | +pass_env = |
| 34 | + TEMPLATEFLOW_HOME |
| 35 | + # Freesurfer variables searched for |
| 36 | + FREESURFER_HOME |
| 37 | + SUBJECTS_DIR |
| 38 | + FS_LICENSE |
| 39 | + # CI variables |
| 40 | + TEST_DATA_HOME |
| 41 | + TEST_OUTPUT_DIR |
| 42 | + TEST_WORK_DIR |
| 43 | + FMRIPREP_REGRESSION_SOURCE |
| 44 | + CACHED_WORK_DIRECTORY |
| 45 | + # CircleCI-specific |
| 46 | + CIRCLE_NPROCS |
| 47 | + SAVE_CIRCLE_ARTIFACTS |
| 48 | + # getpass.getuser() sources for Windows: |
| 49 | + LOGNAME |
| 50 | + USER |
| 51 | + LNAME |
| 52 | + USERNAME |
| 53 | + # Pass user color preferences through |
| 54 | + PY_COLORS |
| 55 | + FORCE_COLOR |
| 56 | + NO_COLOR |
| 57 | + CLICOLOR |
| 58 | + CLICOLOR_FORCE |
| 59 | + PYTHON_GIL |
| 60 | +deps = |
| 61 | + # Waiting on a release |
| 62 | + py313: traits @ git+https://github.com/enthought/traits.git@10954eb |
| 63 | +extras = tests |
| 64 | +setenv = |
| 65 | + pre: PIP_EXTRA_INDEX_URL=https://pypi.anaconda.org/scientific-python-nightly-wheels/simple |
| 66 | + pre: UV_EXTRA_INDEX_URL=https://pypi.anaconda.org/scientific-python-nightly-wheels/simple |
| 67 | +uv_resolution = |
| 68 | + min: lowest-direct |
| 69 | + |
| 70 | +commands = |
| 71 | + pytest --durations=20 --durations-min=1.0 --cov-report term-missing {posargs:-n auto} |
| 72 | + |
| 73 | +[testenv:style] |
| 74 | +description = Check our style guide |
| 75 | +labels = check |
| 76 | +deps = |
| 77 | + ruff |
| 78 | +skip_install = true |
| 79 | +commands = |
| 80 | + ruff check --diff |
| 81 | + ruff format --diff |
| 82 | + |
| 83 | +[testenv:style-fix] |
| 84 | +description = Auto-apply style guide to the extent possible |
| 85 | +labels = pre-release |
| 86 | +deps = |
| 87 | + ruff |
| 88 | +skip_install = true |
| 89 | +commands = |
| 90 | + ruff check --fix |
| 91 | + ruff format |
| 92 | + ruff check --select ISC001 |
| 93 | + |
| 94 | +[testenv:spellcheck] |
| 95 | +description = Check spelling |
| 96 | +labels = check |
| 97 | +deps = |
| 98 | + codespell[toml] |
| 99 | +skip_install = true |
| 100 | +commands = |
| 101 | + codespell . {posargs} |
| 102 | + |
| 103 | +[testenv:build{,-strict}] |
| 104 | +labels = |
| 105 | + check |
| 106 | + pre-release |
| 107 | +deps = |
| 108 | + build |
| 109 | + twine |
| 110 | +skip_install = true |
| 111 | +set_env = |
| 112 | + # Ignore specific known warnings: |
| 113 | + # https://github.com/pypa/pip/issues/11684 |
| 114 | + # https://github.com/pypa/pip/issues/12243 |
| 115 | + strict: PYTHONWARNINGS=error,once:pkg_resources is deprecated as an API.:DeprecationWarning:pip._internal.metadata.importlib._envs,once:Unimplemented abstract methods {'locate_file'}:DeprecationWarning:pip._internal.metadata.importlib._dists |
| 116 | +commands = |
| 117 | + python -m build |
| 118 | + python -m twine check dist/* |
| 119 | + |
| 120 | +[testenv:publish] |
| 121 | +depends = build |
| 122 | +labels = release |
| 123 | +deps = |
| 124 | + twine |
| 125 | +skip_install = true |
| 126 | +commands = |
| 127 | + python -m twine upload dist/* |
0 commit comments