Skip to content

Commit

Permalink
Refactor pinning of python dependencies (#34)
Browse files Browse the repository at this point in the history
* Refactor pinning of python dependencies

- make requirements.txt files compatible with dependabot
- add pre-commit manual check of depdendencies
- update pre-commit hooks
  • Loading branch information
ssbarnea authored Nov 16, 2023
1 parent 0be0c69 commit 565ab32
Show file tree
Hide file tree
Showing 9 changed files with 245 additions and 57 deletions.
1 change: 1 addition & 0 deletions .config/docs-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mkdocs-ansible>=0.2.0
85 changes: 85 additions & 0 deletions .config/lock-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
#
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
# pip-compile --no-annotate --output-file=.config/lock-requirements.txt --strip-extras pyproject.toml
#
ansible-builder==3.0.0
ansible-compat==4.1.10
ansible-core==2.16.0
ansible-lint==6.22.0
ansible-navigator==3.5.0
ansible-runner==2.3.4
ansible-sign==0.1.1
attrs==23.1.0
bindep==2.11.0
black==23.11.0
bracex==2.4
cachetools==5.3.2
certifi==2023.7.22
cffi==1.16.0
chardet==5.2.0
charset-normalizer==3.3.2
click==8.1.7
click-help-colors==0.9.3
colorama==0.4.6
cryptography==41.0.5
distlib==0.3.7
distro==1.8.0
docutils==0.20.1
enrich==1.2.7
exceptiongroup==1.1.3
execnet==2.0.2
filelock==3.13.1
idna==3.4
iniconfig==2.0.0
jinja2==3.1.2
jsonschema==4.19.2
jsonschema-specifications==2023.11.1
lockfile==0.12.2
markdown-it-py==3.0.0
markupsafe==2.1.3
mdurl==0.1.2
molecule==6.0.2
mypy-extensions==1.0.0
onigurumacffi==1.3.0
packaging==23.2
parsley==1.3
pathspec==0.11.2
pbr==6.0.0
pexpect==4.8.0
platformdirs==3.11.0
pluggy==1.3.0
ptyprocess==0.7.0
pycparser==2.21
pygments==2.16.1
pyproject-api==1.6.1
pytest==7.4.3
pytest-ansible==4.1.1
pytest-xdist==3.4.0
python-daemon==3.0.1
python-gnupg==0.5.1
pyyaml==6.0.1
referencing==0.31.0
requests==2.31.0
requirements-parser==0.5.0
resolvelib==1.0.1
rich==13.7.0
rpds-py==0.12.0
ruamel-yaml==0.18.5
ruamel-yaml-clib==0.2.8
six==1.16.0
subprocess-tee==0.4.1
tomli==2.0.1
tox==4.11.3
tox-ansible==2.0.14
types-setuptools==68.2.0.1
typing-extensions==4.8.0
tzdata==2023.3
urllib3==2.1.0
virtualenv==20.24.6
wcmatch==8.5
yamllint==1.33.0

# The following packages are considered to be unsafe in a requirements file:
# setuptools
1 change: 0 additions & 1 deletion .config/requirements-docs.txt

This file was deleted.

141 changes: 99 additions & 42 deletions .config/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,83 +1,140 @@
#
# This file is autogenerated by pip-compile with Python 3.11
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
# pip-compile --extra=docs --extra=test --no-annotate --output-file=requirements.txt
# pip-compile --all-extras --no-annotate --output-file=.config/requirements.txt --strip-extras pyproject.toml
#
ansible-builder==3.0.0
ansible-compat==4.1.5
ansible-core==2.15.2
ansible-lint==6.17.2
ansible-navigator==3.4.2
ansible-runner==2.3.3
ansible-compat==4.1.10
ansible-core==2.16.0
ansible-lint==6.22.0
ansible-navigator==3.5.0
ansible-runner==2.3.4
ansible-sign==0.1.1
attrs==23.1.0
babel==2.13.1
beautifulsoup4==4.12.2
bindep==2.11.0
black==23.9.1
bracex==2.3.post1
cachetools==5.3.1
black==23.11.0
bracex==2.4
build==1.0.3
cachetools==5.3.2
cairocffi==1.6.1
cairosvg==2.7.1
certifi==2023.7.22
cffi==1.15.1
cffi==1.16.0
cfgv==3.4.0
chardet==5.2.0
charset-normalizer==3.2.0
click==8.1.6
click-help-colors==0.9.1
charset-normalizer==3.3.2
click==8.1.7
click-help-colors==0.9.3
colorama==0.4.6
coverage==7.3.0
cryptography==41.0.3
coverage==7.3.2
cryptography==41.0.5
csscompressor==0.9.5
cssselect2==0.7.0
defusedxml==0.7.1
distlib==0.3.7
distro==1.8.0
docstring-parser-fork==0.0.5
docutils==0.20.1
enrich==1.2.7
exceptiongroup==1.1.3
execnet==2.0.2
filelock==3.12.2
filelock==3.13.1
ghp-import==2.1.0
griffe==0.38.0
htmlmin2==0.1.13
identify==2.5.31
idna==3.4
iniconfig==2.0.0
jinja2==3.0.3
jsonschema==4.19.0
jsonschema-specifications==2023.7.1
jinja2==3.1.2
jsmin==3.0.1
jsonschema==4.19.2
jsonschema-specifications==2023.11.1
lockfile==0.12.2
markdown==3.5.1
markdown-exec==1.7.0
markdown-include==0.8.1
markdown-it-py==3.0.0
markupsafe==2.1.3
mdurl==0.1.2
molecule==6.0.0
mergedeep==1.3.4
mkdocs==1.5.3
mkdocs-ansible==0.2.0
mkdocs-autorefs==0.5.0
mkdocs-gen-files==0.5.0
mkdocs-htmlproofer-plugin==1.0.0
mkdocs-material==9.4.8
mkdocs-material-extensions==1.3
mkdocs-minify-plugin==0.7.1
mkdocs-monorepo-plugin==1.0.5
mkdocstrings==0.24.0
mkdocstrings-python==1.7.4
molecule==6.0.2
mypy==1.7.0
mypy-extensions==1.0.0
onigurumacffi==1.2.0
packaging==23.1
nodeenv==1.8.0
onigurumacffi==1.3.0
packaging==23.2
paginate==0.5.6
parsley==1.3
pathspec==0.11.2
pbr==5.11.1
pbr==6.0.0
pexpect==4.8.0
platformdirs==3.10.0
pluggy==1.2.0
pillow==10.1.0
pip-tools==7.3.0
pipdeptree==2.13.1
platformdirs==3.11.0
pluggy==1.3.0
pre-commit==3.5.0
ptyprocess==0.7.0
pycparser==2.21
pydoclint==0.3.8
pygments==2.16.1
pyproject-api==1.5.3
pytest==7.4.0
pytest-ansible==4.0.0
pytest-xdist==3.3.1
pymdown-extensions==10.4
pyproject-api==1.6.1
pyproject-hooks==1.0.0
pytest==7.4.3
pytest-ansible==4.1.1
pytest-xdist==3.4.0
python-daemon==3.0.1
python-dateutil==2.8.2
python-gnupg==0.5.1
python-slugify==8.0.1
pyyaml==6.0.1
referencing==0.30.2
pyyaml-env-tag==0.1
referencing==0.31.0
regex==2023.10.3
requests==2.31.0
requirements-parser==0.5.0
resolvelib==1.0.1
rich==13.5.2
rpds-py==0.9.2
ruamel-yaml==0.17.32
ruamel-yaml-clib==0.2.7
rich==13.7.0
rpds-py==0.12.0
ruamel-yaml==0.18.5
ruamel-yaml-clib==0.2.8
ruff==0.1.5
six==1.16.0
soupsieve==2.5
subprocess-tee==0.4.1
tox==4.8.0
tox-ansible==2.0.9
types-setuptools==68.0.0.3
text-unidecode==1.3
tinycss2==1.2.1
toml-sort==0.23.1
tomli==2.0.1
tomlkit==0.12.3
tox==4.11.3
tox-ansible==2.0.14
types-setuptools==68.2.0.1
typing-extensions==4.8.0
tzdata==2023.3
urllib3==2.0.4
virtualenv==20.24.3
wcmatch==8.4.1
yamllint==1.32.0
urllib3==2.1.0
virtualenv==20.24.6
watchdog==3.0.0
wcmatch==8.5
webencodings==0.5.1
wheel==0.41.3
yamllint==1.33.0

# The following packages are considered to be unsafe in a requirements file:
# pip
# setuptools
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
black
coverage
mypy
pip-tools
pre-commit
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
with:
min_python: "3.10"
max_python: "3.12"
default_python: "3.11" # used by jobs in other_names
default_python: "3.10" # used by jobs in other_names
other_names: |
lint
docs
Expand Down
31 changes: 26 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ ci:
chore: auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
skip:
- deps
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
Expand Down Expand Up @@ -37,7 +39,7 @@ repos:

- repo: https://github.com/pre-commit/mirrors-prettier
# keep it before yamllint
rev: v3.0.3
rev: v3.1.0
hooks:
- id: prettier
always_run: true
Expand All @@ -47,7 +49,7 @@ repos:
- prettier-plugin-sort-json

- repo: https://github.com/psf/black
rev: 23.10.1
rev: 23.11.0
hooks:
- id: black

Expand All @@ -62,13 +64,13 @@ repos:
- id: tox-ini-fmt

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.4
rev: v0.1.5
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]

- repo: https://github.com/streetsidesoftware/cspell-cli
rev: v7.3.2
rev: v8.0.0
hooks:
- id: cspell
name: Spell check with cspell
Expand All @@ -91,7 +93,7 @@ repos:
- tox

- repo: https://github.com/pre-commit/mirrors-mypy.git
rev: v1.6.1
rev: v1.7.0
hooks:
- id: mypy
additional_dependencies:
Expand All @@ -102,3 +104,22 @@ repos:
- src
- tests
pass_filenames: false

- repo: https://github.com/jazzband/pip-tools
rev: 7.3.0
hooks:
- id: pip-compile
name: deps
alias: deps
always_run: true
entry: >
sh -c "
pip-compile -q --no-annotate --output-file=.config/lock-requirements.txt pyproject.toml --strip-extras &&
pip-compile -q --no-annotate --all-extras --output-file=.config/requirements.txt pyproject.toml --strip-extras"
files: ^.config\/requirements.*$
language: python
language_version: "3.10" # minimal we support officially
pass_filenames: false
# stages: [manual]
additional_dependencies:
- pip>=22.3.1
9 changes: 5 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -257,10 +257,11 @@ convention = "pep257"

[tool.setuptools.dynamic]
dependencies = {file = [".config/requirements.in"]}
optional-dependencies.dev = {file = [".config/requirements-dev.txt"]}
optional-dependencies.docs = {file = [".config/requirements-docs.txt"]}
optional-dependencies.lock = {file = [".config/requirements-lock.txt"]}
optional-dependencies.test = {file = [".config/requirements-test.txt"]}
# Dependabot recognize only filenames ending in requirements.txt and cannot
# be configured with diferent pattern.
optional-dependencies.docs = {file = [".config/docs-requirements.txt"]}
optional-dependencies.lock = {file = [".config/lock-requirements.txt"]}
optional-dependencies.test = {file = [".config/test-requirements.txt"]}

[tool.setuptools_scm]
local_scheme = "no-local-version"
Expand Down
Loading

0 comments on commit 565ab32

Please sign in to comment.