From 682e8a9db911fc677d5619939a6299f6f6b43b03 Mon Sep 17 00:00:00 2001 From: Rory Conlin Date: Wed, 11 Dec 2024 15:13:35 -0500 Subject: [PATCH 1/5] Update dev requirements --- .github/dependabot.yml | 30 +++++++++++++++++++++ .pre-commit-config.yaml | 10 +++---- devtools/dev-requirements.txt | 50 +++++++++++++++++++---------------- 3 files changed, 62 insertions(+), 28 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 60841fd13d..0bad7599e9 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -7,6 +7,36 @@ updates: directory: "/" # Location of package manifests schedule: interval: "weekly" + groups: + # group similar dependencies together into fewer PRs + docs: + patterns: + - "sphinx" + linting: + patterns: + - "flake8" + - "black" + - "pre-commit" + testing: + patterns: + - "pytest" + - "qic" + - "qsc" + - "shapely" + minor_packages: + patterns: + - "colorama" + - "nvgpu" + - "psutil" + - "pylatexenc" + - "termcolor" + jax: + patterns: + - "jax" + - "diffrax" + - "interpax" + - "orthax" + - "quadax" - package-ecosystem: "github-actions" directory: "/" schedule: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 88a87097ac..34af57d4e8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,11 +1,11 @@ repos: - repo: https://github.com/psf/black - rev: 24.3.0 + rev: 24.10.0 hooks: - id: black-jupyter log_file: devtools/pre-commit.log - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.3.0 + rev: v5.0.0 hooks: - id: check-added-large-files log_file: devtools/pre-commit.log @@ -22,20 +22,20 @@ repos: - id: no-commit-to-branch log_file: devtools/pre-commit.log - repo: https://github.com/pycqa/isort - rev: 5.12.0 + rev: 5.13.2 hooks: - id: isort name: isort (python) args: ["--profile", "black"] log_file: devtools/pre-commit.log - repo: https://github.com/PyCQA/flake8 - rev: "5.0.4" + rev: "7.1.1" hooks: - id: flake8 additional_dependencies: ["flake8-docstrings", "flake8-eradicate", "flake8-isort"] log_file: devtools/pre-commit.log - repo: https://github.com/asottile/pyupgrade - rev: v3.2.0 + rev: v3.19.0 hooks: - id: pyupgrade log_file: devtools/pre-commit.log diff --git a/devtools/dev-requirements.txt b/devtools/dev-requirements.txt index 4ec9db9447..f9b864eec1 100644 --- a/devtools/dev-requirements.txt +++ b/devtools/dev-requirements.txt @@ -1,37 +1,41 @@ # standard install requirements -r ../requirements.txt +# notes on versioning: +# "major" packages like sphinx, flake8, pytest etc are pinned to a compatible major +# version, eg ~8.0 includes 8.0.0, 8.0.2 etc. We assume these are more careful +# with their versioning since they are primary infrastructure for lots of stuff +# "minor" packages (all the other ones) are pinned to a maximum specific version +# which will need to be updated regularly, but we don't want to do so without testing. + # building the docs -nbsphinx == 0.8.12 -sphinx > 3.0.0 -# TODO (#1396): Remove sphinx-argparse <0.5.0 pin once upstream build issue is fixed -# -sphinx-argparse < 0.5.0 -sphinx_copybutton -sphinx-rtd-theme >= 1.0, < 2.0 -sphinx-github-style >= 1.0, < 2.0 +nbsphinx >= 0.8.12, <= 0.9.5 +sphinx ~= 8.1 +sphinx-argparse >= 0.5.1, <= 0.5.2 +sphinx_copybutton <= 0.5.2 +sphinx-rtd-theme >= 1.0, <= 3.0.2 +sphinx-github-style >= 1.0, <= 1.2.2 # linting -black[jupyter] == 24.3.0 -flake8 >= 5.0.0, <6.0.0 -flake8-docstrings >= 1.0.0, <2.0.0 -flake8-eradicate >= 1.0.0, <2.0.0 -flake8-isort >=5.0.0, < 6.0.0 -pre-commit +black[jupyter] == 24.10.0 +flake8 ~= 7.1 +flake8-docstrings >= 1.0.0, <= 1.7.0 +flake8-eradicate >= 1.0.0, <= 1.5.0 +flake8-isort >= 5.0.0, <= 6.1.1 +pre-commit <= 4.0.1 # testing and benchmarking -markupsafe == 2.0.1 -nbmake -pytest ~= 8.0.0 -pytest-benchmark -pytest-cov >= 2.6.0 -pytest-monitor +nbmake <= 1.5.4 +pytest ~= 8.3 +pytest-benchmark <= 5.1.0 +pytest-cov >= 2.6.0, <= 6.0.0 +pytest-monitor <= 1.6.6 pytest-mpl == 0.16.1 -pytest-split == 0.8.2 +pytest-split >= 0.8.2, <= 0.10.0 qicna @ git+https://github.com/rogeriojorge/pyQIC/ -qsc -shapely >= 1.8.2 +qsc <= 0.1.3 +shapely >= 1.8.2, <= 2.0.6 # building build From 5b95eda59df0862d5ada4fad3fa304abaafa730d Mon Sep 17 00:00:00 2001 From: Rory Conlin Date: Wed, 11 Dec 2024 15:14:35 -0500 Subject: [PATCH 2/5] Remove conda requirements files --- devtools/dev-requirements_conda.yml | 45 ----------------------------- docs/installation.rst | 34 ++-------------------- requirements_conda.yml | 25 ---------------- 3 files changed, 3 insertions(+), 101 deletions(-) delete mode 100644 devtools/dev-requirements_conda.yml delete mode 100644 requirements_conda.yml diff --git a/devtools/dev-requirements_conda.yml b/devtools/dev-requirements_conda.yml deleted file mode 100644 index 9859060a2b..0000000000 --- a/devtools/dev-requirements_conda.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: desc-env -channels: - - conda-forge -dependencies: - - pip - - pip: - # Conda only parses a single list of pip requirements. - # If two pip lists are given, all but the last list is skipped. - # building the docs - - sphinx-github-style >= 1.0, < 2.0 - # testing and benchmarking - - qsc - - qicna @ git+https://github.com/rogeriojorge/pyQIC/ - - black[jupyter] = 24.3.0 - - # building the docs - - nbsphinx == 0.8.12 - - pandoc - - sphinx > 3.0.0 - # TODO (#1396): Remove sphinx-argparse <0.5.0 pin once upstream build issue is fixed - # - - sphinx-argparse < 0.5.0 - - sphinx-copybutton - - sphinx_rtd_theme >= 1.0, < 2.0 - - # linting - - flake8 >= 5.0.0, <6.0.0 - - flake8-docstrings >= 1.0.0, <2.0.0 - - flake8-eradicate >= 1.0.0, <2.0.0 - - flake8-isort >=5.0.0, < 6.0.0 - - pre-commit - - # testing and benchmarking - - markupsafe = 2.0.1 - - nbmake - - pytest = 8.0.0 - - pytest-benchmark - - pytest-cov >= 2.6.0 - - pytest-monitor - - pytest-mpl = 0.16.1 - - pytest-split == 0.8.2 - - shapely >= 1.8.2 - - # building - - python-build diff --git a/docs/installation.rst b/docs/installation.rst index 739bac89b0..9df67563b8 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -36,11 +36,9 @@ First download the repository from GitHub. git clone https://github.com/PlasmaControl/DESC.git cd DESC -Now pick one of the installation options below. +Now use pip to install packages (this will only install DESC + JAX with CPU capabilities, NOT GPU) -Option 1: Using pip to install packages (this will only install DESC + JAX with CPU capabilities, NOT GPU) - -`Option 1 tested to work on M1 Macbook on May 3, 2023` +`tested to work on M1 Macbook on May 3, 2023` .. code-block:: sh @@ -50,17 +48,6 @@ Option 1: Using pip to install packages (this will only install DESC + JAX with # optionally install developer requirements (if you want to run tests) pip install -r devtools/dev-requirements.txt -Option 2: Using conda to install packages (this will only install DESC + JAX with CPU capabilities, NOT GPU) - -.. code-block:: sh - - conda env create --file requirements_conda.yml - # optionally: install developer requirements (if you want to run tests) - conda install --file devtools/dev-requirements_conda.yml - - # to add DESC to your Python path - conda activate desc-env - pip install --no-deps --editable . On Most Linux Computing Clusters ******************************** @@ -88,9 +75,7 @@ First download the repository from GitHub. # load your python module module load anaconda # this command may vary depending on cluster -Now pick one of the installation options below. - -Option 1: Using pip to install packages (this will only install DESC + JAX with CPU capabilities, NOT GPU) +Now use pip to install packages (this will only install DESC + JAX with CPU capabilities, NOT GPU) .. code-block:: sh @@ -100,19 +85,6 @@ Option 1: Using pip to install packages (this will only install DESC + JAX with # optionally install developer requirements (if you want to run tests) pip install -r devtools/dev-requirements.txt -Option 2: Using conda to install packages (this will only install DESC + JAX with CPU capabilities, NOT GPU) - -.. code-block:: sh - - # only need to do one of these conda env create commands, not both - # option A: without developer requirements - conda env create --file requirements_conda.yml - # option B: with developer requirements (if you want to run tests) - conda env create --file devtools/dev-requirements_conda.yml - - # to add DESC to your Python path - conda activate desc-env - pip install --no-deps --editable . With CPU+GPU support -------------------- diff --git a/requirements_conda.yml b/requirements_conda.yml deleted file mode 100644 index 90395277a9..0000000000 --- a/requirements_conda.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: desc-env -dependencies: - # standard install - - colorama <= 0.4.6 - - diffrax >= 0.4.1, <= 0.6.0 - - h5py >= 3.0.0, <= 3.12.1 - - matplotlib >= 3.5.0, <= 3.9.3 - - mpmath >= 1.0.0, <= 1.3.0 - - netcdf4 >= 1.5.4, <= 1.7.2 - - numpy >= 1.20.0, <= 2.1.3 - - psutil <= 6.1.0 - - scipy >= 1.7.0, <= 1.14.1 - - termcolor <= 2.5.0 - - pip - - pip: - # Conda only parses a single list of pip requirements. - # If two pip lists are given, all but the last list is skipped. - - jax >= 0.4.24, <= 0.4.35 - - interpax >= 0.3.3, <= 0.3.4 - - nvgpu <= 0.10.0 - - orthax <= 0.2.1 - - plotly >= 5.16, <= 5.24.1 - - pylatexenc >= 2.0, <= 2.10 - - quadax >= 0.2.2, <= 0.2.4 - - scikit-image <= 0.24.0 From a38ac68ac87bb997c6746a95d38b289a2a4f2d5a Mon Sep 17 00:00:00 2001 From: Rory Conlin Date: Wed, 11 Dec 2024 15:24:05 -0500 Subject: [PATCH 3/5] Allow older versions of sphinx for python 3.9 --- devtools/dev-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devtools/dev-requirements.txt b/devtools/dev-requirements.txt index f9b864eec1..137eaab3d2 100644 --- a/devtools/dev-requirements.txt +++ b/devtools/dev-requirements.txt @@ -10,7 +10,7 @@ # building the docs nbsphinx >= 0.8.12, <= 0.9.5 -sphinx ~= 8.1 +sphinx >= 5.0, <= 8.1 sphinx-argparse >= 0.5.1, <= 0.5.2 sphinx_copybutton <= 0.5.2 sphinx-rtd-theme >= 1.0, <= 3.0.2 From 9b23e0bab4d5651488b6cccbd64a96a355bc1866 Mon Sep 17 00:00:00 2001 From: Rory Conlin Date: Wed, 11 Dec 2024 15:27:55 -0500 Subject: [PATCH 4/5] Allow older version of sphinx-argparse --- devtools/dev-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devtools/dev-requirements.txt b/devtools/dev-requirements.txt index 137eaab3d2..e0f773cbdc 100644 --- a/devtools/dev-requirements.txt +++ b/devtools/dev-requirements.txt @@ -11,7 +11,7 @@ # building the docs nbsphinx >= 0.8.12, <= 0.9.5 sphinx >= 5.0, <= 8.1 -sphinx-argparse >= 0.5.1, <= 0.5.2 +sphinx-argparse >= 0.4.0, != 0.5.0, <= 0.5.2 sphinx_copybutton <= 0.5.2 sphinx-rtd-theme >= 1.0, <= 3.0.2 sphinx-github-style >= 1.0, <= 1.2.2 From e6ef149e4528b4f57a317bf43131b3dd9622e056 Mon Sep 17 00:00:00 2001 From: Rory Conlin Date: Wed, 11 Dec 2024 15:44:41 -0500 Subject: [PATCH 5/5] Remove deprecated parameter from conf.py --- docs/conf.py | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 862858e6d4..4a08894062 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -117,7 +117,6 @@ # 'canonical_url': '', # 'analytics_id': 'UA-XXXXXXX-1', # Provided by Google in your dashboard "logo_only": True, - "display_version": True, "prev_next_buttons_location": "both", "style_external_links": False, "style_nav_header_background": "#3c4142",