diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 97074f1f..cf2215a2 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -41,5 +41,5 @@ // Mount the parent as /workspaces so we can pip install peers as editable "workspaceMount": "source=${localWorkspaceFolder}/..,target=/workspaces,type=bind", // After the container is created, install the python project in editable form - "postCreateCommand": "pip install -c dev-requirements.txt -e '.[dev]'" + "postCreateCommand": "pip install -c requirements/constraints.txt -e '.[dev]'" } \ No newline at end of file diff --git a/.github/workflows/_docs.yml b/.github/workflows/_docs.yml index a8d90f19..6b56fbec 100644 --- a/.github/workflows/_docs.yml +++ b/.github/workflows/_docs.yml @@ -20,7 +20,7 @@ jobs: python-version: "3.11" - name: Install python packages - run: pip install -c dev-requirements.txt -e .[dev] + run: pip install -c requirements/constraints.txt -e .[dev] - name: Build docs run: tox -e docs diff --git a/.github/workflows/_tox.yml b/.github/workflows/_tox.yml index 6e4b312c..d9701fc0 100644 --- a/.github/workflows/_tox.yml +++ b/.github/workflows/_tox.yml @@ -23,7 +23,7 @@ jobs: python-version: "3.11" - name: Install python packages - run: pip install -c dev-requirements.txt -e .[dev] + run: pip install -c requirements/constraints.txt -e .[dev] - name: Run tox run: tox -e ${{ inputs.tox }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a6e42326..3143ae60 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -25,6 +25,6 @@ repos: - id: constraints name: check constraints match installed language: system - entry: pip-compile - files: ^(pyproject\.toml|dev-requirements\.txt)$ + entry: ./requirements/regenerate.sh --if-non-empty + files: ^(pyproject\.toml|requirements/constraints\.txt)$ pass_filenames: false diff --git a/README.md b/README.md index 1cf925ca..a6a15c12 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ Releases | =0.12", "pytest", @@ -60,13 +59,3 @@ select = [ "W", # pycodestyle warnings - https://beta.ruff.rs/docs/rules/#warning-w "I", # isort - https://docs.astral.sh/ruff/rules/#isort-i ] - -[tool.pip-tools] -src-files = ["pyproject.toml"] -extras = ["dev"] -output-file = "dev-requirements.txt" -quiet = true -# Make output suitable for use as a constraints file -strip-extras = true -# Remove annotations as coverage source seems to make false positive in CI -annotate = false diff --git a/dev-requirements.txt b/requirements/constraints.txt similarity index 67% rename from dev-requirements.txt rename to requirements/constraints.txt index d1d9b9cb..81e84b6e 100644 --- a/dev-requirements.txt +++ b/requirements/constraints.txt @@ -1,19 +1,11 @@ -# -# This file is autogenerated by pip-compile with Python 3.11 -# by the following command: -# -# pip-compile --extra=dev --no-annotate --output-file=dev-requirements.txt --strip-extras -# accessible-pygments==0.0.4 alabaster==0.7.16 annotated-types==0.6.0 -babel==2.14.0 -beautifulsoup4==4.12.3 -build==1.0.3 +Babel==2.14.0 +beautifulsoup4==4.12.2 certifi==2023.11.17 cfgv==3.4.0 charset-normalizer==3.3.2 -click==8.1.7 colorama==0.4.6 copier==9.1.1 decorator==5.1.1 @@ -26,11 +18,11 @@ identify==2.5.33 idna==3.6 imagesize==1.4.1 iniconfig==2.0.0 -jinja2==3.1.3 +Jinja2==3.1.3 jinja2-ansible-filters==1.3.2 livereload==2.6.3 markdown-it-py==3.0.0 -markupsafe==2.1.4 +MarkupSafe==2.1.4 mdit-py-plugins==0.4.0 mdurl==0.1.2 myst-parser==2.0.0 @@ -38,7 +30,6 @@ nodeenv==1.8.0 packaging==23.2 pathlib2==2.3.7.post1 pathspec==0.12.1 -pip-tools==7.3.0 platformdirs==4.1.0 pluggy==1.3.0 plumbum==1.8.2 @@ -46,12 +37,11 @@ pre-commit==3.6.0 prompt-toolkit==3.0.36 py==1.11.0 pydantic==2.5.3 -pydantic-core==2.14.6 +pydantic_core==2.14.6 pydata-sphinx-theme==0.15.2 -pygments==2.17.2 -pyproject-hooks==1.0.0 +Pygments==2.17.2 pytest==7.4.4 -pyyaml==6.0.1 +PyYAML==6.0.1 pyyaml-include==1.3.2 questionary==2.0.1 requests==2.31.0 @@ -59,10 +49,10 @@ ruff==0.1.14 six==1.16.0 snowballstemmer==2.2.0 soupsieve==2.5 -sphinx==7.2.6 +Sphinx==7.2.6 sphinx-autobuild==2021.3.14 sphinx-copybutton==0.5.2 -sphinx-design==0.5.0 +sphinx_design==0.5.0 sphinxcontrib-applehelp==1.0.8 sphinxcontrib-devhelp==1.0.6 sphinxcontrib-htmlhelp==2.0.5 @@ -72,12 +62,7 @@ sphinxcontrib-serializinghtml==1.1.10 tornado==6.4 tox==3.28.0 tox-direct==0.4 -typing-extensions==4.9.0 +typing_extensions==4.9.0 urllib3==2.1.0 virtualenv==20.25.0 wcwidth==0.2.13 -wheel==0.42.0 - -# The following packages are considered to be unsafe in a requirements file: -# pip -# setuptools diff --git a/requirements/regenerate.sh b/requirements/regenerate.sh new file mode 100755 index 00000000..9540e7b3 --- /dev/null +++ b/requirements/regenerate.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +CONSTRAINTS="$(dirname $0)/constraints.txt" +if [ "$#" -eq 0 ]; then + # Run with no args then always generate + pip freeze --exclude-editable > $CONSTRAINTS +elif [ "$1" == "--if-non-empty" ]; then + # Under pre-commit only generate if non empty + [ -s "$CONSTRAINTS" ] && pip freeze --exclude-editable > $CONSTRAINTS +else + # Not recognised, provide help + cat <