From 45e4e14b0a6f372e4d6c0a361f2da78149b902a8 Mon Sep 17 00:00:00 2001 From: M Bussonnier Date: Mon, 3 Jun 2024 15:40:10 -0700 Subject: [PATCH] Make regenerating requirements unnecessary Point back at pyproject.toml this might avoid a pre-commit and avoid out of sync things. --- .pre-commit-config.yaml | 8 -------- requirements/default.txt | 6 +----- requirements/developer.txt | 5 +---- requirements/doc.txt | 8 +------- requirements/test.txt | 6 +----- tools/generate_requirements.py | 2 +- 6 files changed, 5 insertions(+), 30 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index cd7c3531..c8c45652 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -31,14 +31,6 @@ repos: args: ["--fix", "--show-fixes", "--exit-non-zero-on-fix"] - id: ruff-format - - repo: local - hooks: - - id: generate_requirements.py - name: generate_requirements.py - language: system - entry: python tools/generate_requirements.py - files: "pyproject.toml|requirements/.*\\.txt|tools/generate_requirements.py" - ci: autofix_prs: false autofix_commit_msg: | diff --git a/requirements/default.txt b/requirements/default.txt index 5a1986a1..fc996ca8 100644 --- a/requirements/default.txt +++ b/requirements/default.txt @@ -1,5 +1 @@ -# Generated via tools/generate_requirements.py and pre-commit hook. -# Do not edit this file; modify pyproject.toml instead. -sphinx>=6 -tabulate>=0.8.10 -tomli>=1.1.0;python_version<'3.11' +.[default] diff --git a/requirements/developer.txt b/requirements/developer.txt index dbeefe57..8b4852cd 100644 --- a/requirements/developer.txt +++ b/requirements/developer.txt @@ -1,4 +1 @@ -# Generated via tools/generate_requirements.py and pre-commit hook. -# Do not edit this file; modify pyproject.toml instead. -pre-commit>=3.3 -tomli; python_version < '3.11' +.[developer] diff --git a/requirements/doc.txt b/requirements/doc.txt index 950966b6..3ef37020 100644 --- a/requirements/doc.txt +++ b/requirements/doc.txt @@ -1,7 +1 @@ -# Generated via tools/generate_requirements.py and pre-commit hook. -# Do not edit this file; modify pyproject.toml instead. -numpy>=1.22 -matplotlib>=3.5 -pydata-sphinx-theme>=0.13.3 -sphinx>=7 -intersphinx_registry +.[doc] diff --git a/requirements/test.txt b/requirements/test.txt index 2a9e670f..dcb92cfe 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -1,5 +1 @@ -# Generated via tools/generate_requirements.py and pre-commit hook. -# Do not edit this file; modify pyproject.toml instead. -pytest -pytest-cov -matplotlib +.[test] diff --git a/tools/generate_requirements.py b/tools/generate_requirements.py index 388d2ccc..b090df6c 100755 --- a/tools/generate_requirements.py +++ b/tools/generate_requirements.py @@ -23,7 +23,7 @@ def generate_requirement_file(name: str, req_list: list[str]) -> None: req_fname = repo_dir / "requirements" / f"{name}.txt" - req_fname.write_text("\n".join(header + req_list) + "\n") + req_fname.write_text(f".[{name}]\n") def main() -> None: