From 6f2625c4d8021e98ebc9adc7d180a32e4f2ef8bf Mon Sep 17 00:00:00 2001 From: Nathaniel Starkman Date: Thu, 18 May 2023 14:29:12 -0400 Subject: [PATCH] config Signed-off-by: Nathaniel Starkman --- pyproject.toml | 3 +++ tox.ini | 29 ++++++++++++++++++++++------- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 67b3000..70f2598 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,6 +26,9 @@ ] [project.optional-dependencies] + all = [ + "cosmology.api >= 0.1.0", # is this needed? + ] test = [ "coverage[toml]", "numpy>=1.20", diff --git a/tox.ini b/tox.ini index 6df2b45..37e9778 100644 --- a/tox.ini +++ b/tox.ini @@ -52,7 +52,7 @@ deps = # The oldestdeps factor is intended to be used to install the oldest # versions of all dependencies that have a minimum version. - oldestdeps: numpy==1.18.* + oldestdeps: numpy==1.21.* devdeps: :NIGHTLY:numpy devdeps: git+https://github.com/scipy/scipy.git#egg=scipy @@ -65,10 +65,23 @@ extras = commands = pip freeze - !cov-!double: pytest --pyargs {toxinidir}/tests {posargs} - cov-!double: pytest --pyargs {toxinidir}/tests --cov cosmology --cov-config={toxinidir}/pyproject.toml {posargs} + !cov-!double: pytest --pyargs {toxinidir}/tests {toxinidir}/docs {posargs} + cov-!double: pytest --pyargs {toxinidir}/tests {toxinidir}/docs --cov cosmology --cov-config={toxinidir}/pyproject.toml {posargs} cov: coverage xml -o {toxinidir}/coverage.xml + +# This lets developers use tox to build docs and ignores warnings. +# This is not used in CI; For that, we have RTD PR builder. +[testenv:build_docs] +changedir = docs +description = invoke sphinx-build to build the HTML docs +extras = docs +commands = + pip freeze + sphinx-build -b html . _build/html {posargs:-j auto} + + + [testenv:codestyle] skip_install = true description = Run all style and file checks with pre-commit @@ -78,18 +91,20 @@ commands = pre-commit install-hooks pre-commit run {posargs:--color always --all-files --show-diff-on-failure} + [pytest] testpaths = tests src/cosmology/ -astropy_header = True -doctest_plus = enabled + docs text_file_format = rst -addopts = --doctest-rst +addopts = -p no:doctest markers = incompatible_with_mypyc: run when testing mypyc compiled code filterwarnings = # tomlkit ignore:The config value # distutils - ignore:distutils Version classes are deprecated\. + ignore:distutils Version classes are deprecated:DeprecationWarning + # NumPy + ignore:The numpy.array_api submodule is still experimental. See NEP 47.:UserWarning