Skip to content

Commit

Permalink
Make regenerating requirements unnecessary
Browse files Browse the repository at this point in the history
Point back at pyproject.toml this might avoid a pre-commit and avoid out of sync things.
  • Loading branch information
Carreau committed Jun 3, 2024
1 parent 58530b9 commit 45e4e14
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 30 deletions.
8 changes: 0 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
6 changes: 1 addition & 5 deletions requirements/default.txt
Original file line number Diff line number Diff line change
@@ -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]
5 changes: 1 addition & 4 deletions requirements/developer.txt
Original file line number Diff line number Diff line change
@@ -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]
8 changes: 1 addition & 7 deletions requirements/doc.txt
Original file line number Diff line number Diff line change
@@ -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]
6 changes: 1 addition & 5 deletions requirements/test.txt
Original file line number Diff line number Diff line change
@@ -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]
2 changes: 1 addition & 1 deletion tools/generate_requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 45e4e14

Please sign in to comment.