From 621c71a63bafaa8f89757ee2120c8f74d87f6e8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Robert?= Date: Tue, 10 Sep 2024 10:14:56 +0200 Subject: [PATCH] DEP: move dev-only dependencies to requirements files --- .github/dependabot.yml | 9 +++ .github/workflows/type-checking.yaml | 2 +- MANIFEST.in | 1 + doc/source/developing/building_the_docs.rst | 2 +- pyproject.toml | 37 +---------- requirements/docs.txt | 12 ++++ requirements/minimal_env.txt | 69 +++++++++++++++++++++ requirements/typecheck.txt | 5 ++ tests/ci_install.sh | 2 +- 9 files changed, 101 insertions(+), 38 deletions(-) create mode 100644 requirements/docs.txt create mode 100644 requirements/minimal_env.txt create mode 100644 requirements/typecheck.txt diff --git a/.github/dependabot.yml b/.github/dependabot.yml index e9767227a12..2ed6f7807c4 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,5 +1,14 @@ version: 2 updates: +- package-ecosystem: pip + directory: /requirements + schedule: + interval: monthly + groups: + actions: + patterns: + - '*' + - package-ecosystem: github-actions directory: /.github/workflows schedule: diff --git a/.github/workflows/type-checking.yaml b/.github/workflows/type-checking.yaml index 6931f4a45e4..3c7f7307d2f 100644 --- a/.github/workflows/type-checking.yaml +++ b/.github/workflows/type-checking.yaml @@ -37,7 +37,7 @@ jobs: - name: Build run: | python3 -m pip install --upgrade pip - python3 -m pip install -e .[typecheck] + python3 -m pip install -e . -r requirements/typecheck.txt - run: python -m pip list diff --git a/MANIFEST.in b/MANIFEST.in index e1e1eb29d52..71e1ac16081 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -70,5 +70,6 @@ include yt/default.mplstyle prune yt/frontends/_skeleton recursive-include yt/frontends/amrvac *.par +exclude requirements exclude .codecov.yml .coveragerc .git-blame-ignore-revs .gitmodules .hgchurn .mailmap exclude .pre-commit-config.yaml clean.sh nose_answer.cfg nose_unit.cfg nose_ignores.txt diff --git a/doc/source/developing/building_the_docs.rst b/doc/source/developing/building_the_docs.rst index e1b56298026..ef8d08b8c60 100644 --- a/doc/source/developing/building_the_docs.rst +++ b/doc/source/developing/building_the_docs.rst @@ -90,7 +90,7 @@ the top level of a local copy, run .. code-block:: bash - $ python -m pip install -e ".[doc]" + $ python -m pip install -e . -r requirements/docs.txt Quick versus Full Documentation Builds ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/pyproject.toml b/pyproject.toml index 86bdc5de23f..85f9189d2f9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -42,6 +42,8 @@ keywords = [ "astronomy astrophysics visualization amr adaptivemeshrefinement", ] requires-python = ">=3.9.2" + +# keep in sync with requirements/minimal_env.txt dependencies = [ "cmyt>=1.1.2", "ewah-bool-utils>=1.2.0", @@ -190,37 +192,9 @@ full = [ ] # dev-only extra targets -doc = [ - "alabaster>=0.7.13", - "bottle>=0.12.25", - "ipykernel>=6.29.4", - "jinja2<3.1.0", # see https://github.com/readthedocs/readthedocs.org/issues/9037 - "jupyter-client>=8.3.1", - "nbsphinx>=0.9.3", - "nose~=1.3.7; python_version < '3.10'", - "pytest>=6.1", - "pyx>=0.15", - "sphinx>=7.2.5", - "sphinx-bootstrap-theme>=0.8.1", - "sphinx-rtd-theme>=1.3.0", -] mapserver = [ "bottle", ] -minimal = [ - "cmyt==1.1.2", - "ewah-bool-utils==1.2.0", - "matplotlib==3.5", - "more-itertools==8.4", - "numpy==1.19.3", - "packaging==20.9", - "pillow==8.0.0", - "tomli-w==0.4.0", - "tqdm==3.4.0", - "unyt==2.9.2", - "tomli==1.2.3;python_version < '3.11'", - "typing-extensions==4.4.0;python_version < '3.12'", -] test = [ "pyaml>=17.10.0", "pytest>=6.1", @@ -231,13 +205,6 @@ test = [ "nose-timer~=1.0.0; python_version < '3.10'", "imageio!=2.35.0", # see https://github.com/yt-project/yt/issues/4966 ] -typecheck = [ - "mypy==1.8.0", - "types-PyYAML==6.0.12.12", - "types-chardet==5.0.4.6", - "types-requests==2.31.0.20240125", - "typing-extensions==4.4.0; python_version < '3.12'", -] [project.scripts] yt = "yt.utilities.command_line:run_main" diff --git a/requirements/docs.txt b/requirements/docs.txt new file mode 100644 index 00000000000..e577a5b968d --- /dev/null +++ b/requirements/docs.txt @@ -0,0 +1,12 @@ +alabaster>=0.7.13 +bottle>=0.12.25 +ipykernel>=6.29.4 +jinja2<3.1.0 # see https://github.com/readthedocs/readthedocs.org/issues/9037 +jupyter-client>=8.3.1 +nbsphinx>=0.9.3 +nose~=1.3.7; python_version < '3.10' +pytest>=6.1 +pyx>=0.15 +sphinx>=7.2.5 +sphinx-bootstrap-theme>=0.8.1 +sphinx-rtd-theme>=1.3.0 diff --git a/requirements/minimal_env.txt b/requirements/minimal_env.txt new file mode 100644 index 00000000000..086d0076d2c --- /dev/null +++ b/requirements/minimal_env.txt @@ -0,0 +1,69 @@ +# This file was autogenerated by uv via the following command: +# uv pip compile pyproject.toml --python=3.9 --python-platform=x86_64-unknown-linux-gnu --resolution=lowest-direct --no-build +cmyt==1.1.2 + # via yt (pyproject.toml) +colorspacious==1.1.2 + # via cmyt +cycler==0.12.1 + # via matplotlib +ewah-bool-utils==1.2.0 + # via yt (pyproject.toml) +fonttools==4.53.1 + # via matplotlib +kiwisolver==1.4.7 + # via matplotlib +matplotlib==3.5.0 + # via + # yt (pyproject.toml) + # cmyt +more-itertools==8.4.0 + # via + # yt (pyproject.toml) + # cmyt +mpmath==1.3.0 + # via sympy +numpy==1.19.3 + # via + # yt (pyproject.toml) + # cmyt + # colorspacious + # ewah-bool-utils + # matplotlib + # unyt +packaging==20.9 + # via + # yt (pyproject.toml) + # matplotlib + # setuptools-scm +pillow==8.0.0 + # via + # yt (pyproject.toml) + # matplotlib +pyparsing==3.1.4 + # via + # matplotlib + # packaging +python-dateutil==2.9.0.post0 + # via matplotlib +setuptools==74.1.2 + # via setuptools-scm +setuptools-scm==8.1.0 + # via matplotlib +six==1.16.0 + # via python-dateutil +sympy==1.13.2 + # via unyt +tomli==1.2.3 + # via + # yt (pyproject.toml) + # setuptools-scm +tomli-w==0.4.0 + # via yt (pyproject.toml) +tqdm==3.4.0 + # via yt (pyproject.toml) +typing-extensions==4.4.0 + # via + # yt (pyproject.toml) + # setuptools-scm +unyt==2.9.2 + # via yt (pyproject.toml) diff --git a/requirements/typecheck.txt b/requirements/typecheck.txt new file mode 100644 index 00000000000..8d0e0ceaffa --- /dev/null +++ b/requirements/typecheck.txt @@ -0,0 +1,5 @@ +mypy==1.8.0 +types-PyYAML==6.0.12.12 +types-chardet==5.0.4.6 +types-requests==2.31.0.20240125 +typing-extensions==4.4.0; python_version < '3.12' diff --git a/tests/ci_install.sh b/tests/ci_install.sh index b73c90f739b..a29d9d53341 100644 --- a/tests/ci_install.sh +++ b/tests/ci_install.sh @@ -32,7 +32,7 @@ fi # but the primary intention is to embed this script in CI jobs if [[ ${dependencies} == "minimal" ]]; then # test with minimal versions of runtime dependencies - python -m pip install -e ".[test,minimal]" + python -m pip install -e ".[test]" -r requirements/minimal_env.txt elif [[ ${dependencies} == "cartopy" ]]; then python -m pip install 'cartopy>=0.22' # scipy is an optional dependency to cartopy