Skip to content

Commit

Permalink
Replace pipdeptree and pip-tools with uv
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea committed Jan 29, 2025
1 parent 45db06d commit 41600f0
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 28 deletions.
25 changes: 9 additions & 16 deletions .config/constraints.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
# This file was autogenerated by uv via the following command:
# tox run -e deps
ansi2html==1.9.2 # via molecule (pyproject.toml)
ansible-compat==25.1.0 # via ansible-lint, molecule (pyproject.toml)
ansible-lint==25.1.0 # via molecule (pyproject.toml)
ansible-compat==25.1.1 # via ansible-lint, molecule (pyproject.toml)
ansible-lint==25.1.1 # via molecule (pyproject.toml)
astroid==3.3.8 # via pylint
attrs==25.1.0 # via jsonschema, referencing
babel==2.16.0 # via mkdocs-material
beautifulsoup4==4.12.3 # via linkchecker, mkdocs-htmlproofer-plugin
black==24.10.0 # via ansible-lint, molecule (pyproject.toml)
black==25.1.0 # via ansible-lint, molecule (pyproject.toml)
bracex==2.5.post1 # via wcmatch
build==1.2.2.post1 # via pip-tools
cachetools==5.5.1 # via tox
cairocffi==1.7.1 # via cairosvg
cairosvg==2.7.1 # via mkdocs-ansible
Expand All @@ -18,7 +17,7 @@ cffi==1.17.1 # via cairocffi, cryptography
cfgv==3.4.0 # via pre-commit
chardet==5.2.0 # via tox
charset-normalizer==3.4.1 # via requests
click==8.1.8 # via black, click-help-colors, mkdocs, mkdocstrings, pip-tools, pydoclint, molecule (pyproject.toml)
click==8.1.8 # via black, click-help-colors, mkdocs, mkdocstrings, pydoclint, molecule (pyproject.toml)
click-help-colors==0.9.4 # via molecule (pyproject.toml)
colorama==0.4.6 # via griffe, mkdocs-material, tox
coverage==7.6.10 # via molecule (pyproject.toml)
Expand All @@ -43,7 +42,7 @@ identify==2.6.6 # via pre-commit
idna==3.10 # via requests
importlib-metadata==8.6.1 # via ansible-lint
iniconfig==2.0.0 # via pytest
isort==5.13.2 # via pylint
isort==6.0.0 # via pylint
jinja2==3.1.5 # via ansible-core, mkdocs, mkdocs-macros-plugin, mkdocs-material, mkdocstrings, molecule (pyproject.toml)
jsmin==3.0.1 # via mkdocs-minify-plugin
jsonschema==4.23.0 # via ansible-compat, ansible-lint, molecule (pyproject.toml)
Expand Down Expand Up @@ -73,24 +72,21 @@ mkdocstrings-python==1.13.0 # via mkdocs-ansible
mypy==1.14.1 # via molecule (pyproject.toml)
mypy-extensions==1.0.0 # via black, mypy
nodeenv==1.9.1 # via pre-commit
packaging==24.2 # via ansible-compat, ansible-core, ansible-lint, black, build, mkdocs, mkdocs-macros-plugin, pipdeptree, pyproject-api, pytest, tox, molecule (pyproject.toml)
packaging==24.2 # via ansible-compat, ansible-core, ansible-lint, black, mkdocs, mkdocs-macros-plugin, pyproject-api, pytest, tox, molecule (pyproject.toml)
paginate==0.5.7 # via mkdocs-material
pathspec==0.12.1 # via ansible-lint, black, mkdocs, mkdocs-macros-plugin, yamllint
pexpect==4.9.0 # via molecule (pyproject.toml)
pillow==11.1.0 # via cairosvg, mkdocs-ansible
pip-tools==7.4.1 # via molecule (pyproject.toml)
pipdeptree==2.24.0 # via molecule (pyproject.toml)
platformdirs==4.3.6 # via black, mkdocs-get-deps, mkdocstrings, pylint, tox, virtualenv
pluggy==1.5.0 # via pytest, tox, molecule (pyproject.toml)
pre-commit==4.1.0 # via molecule (pyproject.toml)
ptyprocess==0.7.0 # via pexpect
pycparser==2.22 # via cffi
pydoclint==0.6.0 # via molecule (pyproject.toml)
pygments==2.19.1 # via mkdocs-material, rich
pylint==3.3.3 # via molecule (pyproject.toml)
pymdown-extensions==10.14.1 # via markdown-exec, mkdocs-ansible, mkdocs-material, mkdocstrings
pylint==3.3.4 # via molecule (pyproject.toml)
pymdown-extensions==10.14.2 # via markdown-exec, mkdocs-ansible, mkdocs-material, mkdocstrings
pyproject-api==1.9.0 # via tox
pyproject-hooks==1.2.0 # via build, pip-tools
pytest==8.3.4 # via pytest-instafail, pytest-mock, pytest-plus, pytest-testinfra, pytest-xdist, molecule (pyproject.toml)
pytest-instafail==0.5.0 # via molecule (pyproject.toml)
pytest-mock==3.14.0 # via molecule (pyproject.toml)
Expand All @@ -109,7 +105,6 @@ rpds-py==0.22.3 # via jsonschema, referencing
ruamel-yaml==0.18.10 # via ansible-lint
ruamel-yaml-clib==0.2.12 # via ruamel-yaml
ruff==0.9.3 # via molecule (pyproject.toml)
setuptools==75.8.0 # via pip-tools
six==1.17.0 # via python-dateutil
soupsieve==2.6 # via beautifulsoup4
subprocess-tee==0.4.2 # via ansible-compat, ansible-lint
Expand All @@ -118,7 +113,7 @@ termcolor==2.5.0 # via mkdocs-macros-plugin
text-unidecode==1.3 # via python-slugify
tinycss2==1.4.0 # via cairosvg, cssselect2
toml-sort==0.24.2 # via molecule (pyproject.toml)
tomli==2.2.1 # via black, build, coverage, mypy, pip-tools, pydoclint, pylint, pyproject-api, pytest, tox
tomli==2.2.1 # via black, coverage, mypy, pydoclint, pylint, pyproject-api, pytest, tox
tomlkit==0.13.2 # via pylint, toml-sort
tox==4.24.1 # via molecule (pyproject.toml)
types-jsonschema==4.23.0.20241208 # via molecule (pyproject.toml)
Expand All @@ -129,12 +124,10 @@ virtualenv==20.29.1 # via pre-commit, tox
watchdog==6.0.0 # via mkdocs
wcmatch==10.0 # via ansible-lint, molecule (pyproject.toml)
webencodings==0.5.1 # via cssselect2, tinycss2
wheel==0.45.1 # via pip-tools
yamllint==1.35.1 # via ansible-lint
zipp==3.21.0 # via importlib-metadata

# The following packages were excluded from the output:
# ansible-core
# pip
# resolvelib
# typing-extensions
1 change: 0 additions & 1 deletion .config/requirements-docs.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
mkdocs-ansible>=24.3.0
pipdeptree>=2.4.0
linkchecker>=10.4.0
1 change: 0 additions & 1 deletion .config/requirements-test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ docker >= 7.1.0 # testing
filelock >= 3.9.0
mypy
pexpect >= 4.9.0, < 5
pip-tools
pre-commit
pydoclint
pylint
Expand Down
9 changes: 5 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ repos:
- prettier-plugin-sort-json

- repo: https://github.com/psf/black
rev: 24.10.0
rev: 25.1.0
hooks:
- id: black

Expand Down Expand Up @@ -83,7 +83,7 @@ repos:
pass_filenames: false

- repo: https://github.com/pycqa/pylint.git
rev: v3.3.3
rev: v3.3.4
hooks:
- id: pylint
args:
Expand Down Expand Up @@ -127,7 +127,8 @@ repos:
- id: pip-compile-upgrade
# To run it execute: `pre-commit run pip-compile-upgrade --hook-stage manual`
name: Upgrade constraints files and requirements
files: ^(pyproject\.toml|requirements\.txt)$
files: ^(pyproject\.toml|.config/.*)$
always_run: true
language: python
entry: python3 -m uv pip compile -q --all-extras --output-file=.config/constraints.txt pyproject.toml --upgrade
pass_filenames: false
Expand All @@ -145,7 +146,7 @@ repos:
additional_dependencies:
- uv>=0.5.21
- repo: https://github.com/ansible/ansible-lint
rev: v25.1.0
rev: v25.1.1
hooks:
- id: ansible-lint
stages: [manual]
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,7 @@ no-emit-package = [
"ansible-core",
"pip",
"resolvelib",
"ruamel-yaml-clib",
"typing_extensions",
"uv"
]
2 changes: 1 addition & 1 deletion tests/unit/model/v2/test_provisioner_section.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def _model_provisioner_allows_ansible_section_data(): # type: ignore[no-untyped

@pytest.mark.parametrize(
"config",
[("_model_provisioner_allows_ansible_section_data")], # noqa: PT007
["_model_provisioner_allows_ansible_section_data"], # noqa: PT007
indirect=True,
)
def test_provisioner_allows_name(config): # type: ignore[no-untyped-def] # noqa: ANN201, D103
Expand Down
2 changes: 1 addition & 1 deletion tools/smoketest.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

ANSIBLE=$(pipdeptree --reverse -p ansible)
ANSIBLE=$(uv pip tree --invert --package ansible-core --strict)

if [ -z "$ANSIBLE" ]; then
echo "Ansible dependency not detected."
Expand Down
8 changes: 4 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ deps =
extras =
commands_pre =
commands =
-pre-commit run --all-files --show-diff-on-failure --hook-stage manual deps
-pre-commit autoupdate
pre-commit run --all-files --show-diff-on-failure --hook-stage manual pip-compile-upgrade
pre-commit autoupdate
git diff --exit-code
env_dir = {toxworkdir}/lint

Expand Down Expand Up @@ -119,14 +119,14 @@ package = editable
pip_pre = true
deps =
molecule-plugins[azure,containers,docker,ec2,gce,podman,vagrant]>=23
pipdeptree>=2
tox-ansible>=1.5.1
uv
extras =
test
commands_pre =
commands =
pip check
pipdeptree --reverse -e pip,pbr,six,setuptools,toml,urllib3
uv pip tree --invert
molecule --version
molecule drivers
sh -c ./tools/smoketest.sh

0 comments on commit 41600f0

Please sign in to comment.