Skip to content

Commit

Permalink
Start using uv
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea committed Nov 7, 2024
1 parent 878478c commit c09175c
Show file tree
Hide file tree
Showing 5 changed files with 144 additions and 141 deletions.
231 changes: 111 additions & 120 deletions .config/constraints.txt
Original file line number Diff line number Diff line change
@@ -1,122 +1,113 @@
#
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
# pip-compile --all-extras --no-annotate --output-file=.config/constraints.txt --strip-extras .config/requirements.in pyproject.toml
#
ansible-compat==24.9.1
ansible-core==2.17.6
astroid==3.3.5
attrs==24.2.0
babel==2.16.0
beautifulsoup4==4.12.3
black==24.10.0
build==1.2.2.post1
cachetools==5.5.0
cairocffi==1.7.1
cairosvg==2.7.1
certifi==2024.8.30
cffi==1.17.1
cfgv==3.4.0
chardet==5.2.0
charset-normalizer==3.4.0
click==8.1.7
colorama==0.4.6
coverage==7.6.4
cryptography==43.0.3
csscompressor==0.9.5
cssselect2==0.7.0
defusedxml==0.7.1
dill==0.3.9
distlib==0.3.9
dnspython==2.7.0
docstring-parser-fork==0.0.9
exceptiongroup==1.2.2
execnet==2.1.1
filelock==3.16.1
ghp-import==2.1.0
griffe==1.5.1
hjson==3.1.0
htmlmin2==0.1.13
identify==2.6.1
idna==3.10
iniconfig==2.0.0
isort==5.13.2
jinja2==3.1.4
jsmin==3.0.1
jsonschema==4.23.0
jsonschema-specifications==2024.10.1
linkchecker==10.5.0
markdown==3.7
markdown-exec==1.9.3
markdown-include==0.8.1
markupsafe==3.0.2
mccabe==0.7.0
mergedeep==1.3.4
mkdocs==1.6.1
mkdocs-ansible==24.3.1
mkdocs-autorefs==1.2.0
mkdocs-gen-files==0.5.0
mkdocs-get-deps==0.2.0
mkdocs-htmlproofer-plugin==1.3.0
mkdocs-macros-plugin==1.3.7
mkdocs-material==9.5.44
mkdocs-material-extensions==1.3.1
mkdocs-minify-plugin==0.8.0
mkdocs-monorepo-plugin==1.1.0
mkdocstrings==0.26.2
mkdocstrings-python==1.12.2
mypy==1.13.0
mypy-extensions==1.0.0
nodeenv==1.9.1
packaging==24.1
paginate==0.5.7
pathspec==0.12.1
pillow==11.0.0
pip-tools==7.4.1
pipdeptree==2.23.4
platformdirs==4.3.6
pluggy==1.5.0
pre-commit==4.0.1
pycparser==2.22
pydoclint==0.5.9
pygments==2.18.0
pylint==3.3.1
pymdown-extensions==10.12
pyproject-api==1.8.0
pyproject-hooks==1.2.0
pytest==8.3.3
pytest-ansible==24.9.0
pytest-xdist==3.6.1
python-dateutil==2.9.0.post0
python-slugify==8.0.4
pyyaml==6.0.2
pyyaml-env-tag==0.1
referencing==0.35.1
regex==2024.9.11
requests==2.32.3
resolvelib==1.0.1
rpds-py==0.21.0
ruff==0.7.2
six==1.16.0
soupsieve==2.6
subprocess-tee==0.4.2
super-collections==0.5.3
termcolor==2.5.0
text-unidecode==1.3
tinycss2==1.4.0
toml-sort==0.23.1
tomli==2.0.2
tomlkit==0.13.2
tox==4.23.2
types-pyyaml==6.0.12.20240917
typing-extensions==4.12.2
urllib3==2.2.3
virtualenv==20.27.1
watchdog==6.0.0
webencodings==0.5.1
wheel==0.44.0
# This file was autogenerated by uv via the following command:
# tox run deps
ansible-compat==24.9.1 # via pytest-ansible
astroid==3.3.5 # via pylint
attrs==24.2.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 tox-ansible (pyproject.toml)
cachetools==5.5.0 # via tox
cairocffi==1.7.1 # via cairosvg
cairosvg==2.7.1 # via mkdocs-ansible
certifi==2024.8.30 # via requests
cffi==1.17.1 # via cairocffi, cryptography
cfgv==3.4.0 # via pre-commit
chardet==5.2.0 # via tox
charset-normalizer==3.4.0 # via requests
click==8.1.7 # via black, mkdocs, mkdocstrings, pydoclint
colorama==0.4.6 # via griffe, mkdocs-material, tox
coverage==7.6.4 # via tox-ansible (pyproject.toml)
cryptography==43.0.3 # via ansible-core
csscompressor==0.9.5 # via mkdocs-minify-plugin
cssselect2==0.7.0 # via cairosvg
defusedxml==0.7.1 # via cairosvg
dill==0.3.9 # via pylint
distlib==0.3.9 # via virtualenv
dnspython==2.7.0 # via linkchecker
docstring-parser-fork==0.0.9 # via pydoclint
exceptiongroup==1.2.2 # via pytest
execnet==2.1.1 # via pytest-xdist
filelock==3.16.1 # via tox, virtualenv
ghp-import==2.1.0 # via mkdocs
griffe==1.5.1 # via mkdocstrings-python
hjson==3.1.0 # via mkdocs-macros-plugin, super-collections
htmlmin2==0.1.13 # via mkdocs-minify-plugin
identify==2.6.1 # via pre-commit
idna==3.10 # via requests
iniconfig==2.0.0 # via pytest
isort==5.13.2 # via pylint
jinja2==3.1.4 # via ansible-core, mkdocs, mkdocs-macros-plugin, mkdocs-material, mkdocstrings
jsmin==3.0.1 # via mkdocs-minify-plugin
jsonschema==4.23.0 # via ansible-compat
jsonschema-specifications==2024.10.1 # via jsonschema
linkchecker==10.5.0 # via mkdocs-ansible
markdown==3.7 # via markdown-include, mkdocs, mkdocs-autorefs, mkdocs-htmlproofer-plugin, mkdocs-material, mkdocstrings, pymdown-extensions
markdown-exec==1.9.3 # via mkdocs-ansible
markdown-include==0.8.1 # via mkdocs-ansible
markupsafe==3.0.2 # via jinja2, mkdocs, mkdocs-autorefs, mkdocstrings
mccabe==0.7.0 # via pylint
mergedeep==1.3.4 # via mkdocs, mkdocs-get-deps
mkdocs==1.6.1 # via mkdocs-ansible, mkdocs-autorefs, mkdocs-gen-files, mkdocs-htmlproofer-plugin, mkdocs-macros-plugin, mkdocs-material, mkdocs-minify-plugin, mkdocs-monorepo-plugin, mkdocstrings
mkdocs-ansible==24.3.1 # via tox-ansible (pyproject.toml)
mkdocs-autorefs==1.2.0 # via mkdocstrings, mkdocstrings-python
mkdocs-gen-files==0.5.0 # via mkdocs-ansible
mkdocs-get-deps==0.2.0 # via mkdocs
mkdocs-htmlproofer-plugin==1.3.0 # via mkdocs-ansible
mkdocs-macros-plugin==1.3.7 # via mkdocs-ansible
mkdocs-material==9.5.44 # via mkdocs-ansible
mkdocs-material-extensions==1.3.1 # via mkdocs-ansible, mkdocs-material
mkdocs-minify-plugin==0.8.0 # via mkdocs-ansible
mkdocs-monorepo-plugin==1.1.0 # via mkdocs-ansible
mkdocstrings==0.26.2 # via mkdocs-ansible, mkdocstrings-python
mkdocstrings-python==1.12.2 # via mkdocs-ansible
mypy==1.13.0 # via tox-ansible (pyproject.toml)
mypy-extensions==1.0.0 # via black, mypy
nodeenv==1.9.1 # via pre-commit
packaging==24.1 # via ansible-compat, ansible-core, black, mkdocs, mkdocs-macros-plugin, pipdeptree, pyproject-api, pytest, pytest-ansible, tox
paginate==0.5.7 # via mkdocs-material
pathspec==0.12.1 # via black, mkdocs, mkdocs-macros-plugin
pillow==11.0.0 # via cairosvg, mkdocs-ansible
pipdeptree==2.23.4 # via mkdocs-ansible, tox-ansible (pyproject.toml)
platformdirs==4.3.6 # via black, mkdocs-get-deps, mkdocstrings, pylint, tox, virtualenv
pluggy==1.5.0 # via pytest, tox
pre-commit==4.0.1 # via tox-ansible (pyproject.toml)
pycparser==2.22 # via cffi
pydoclint==0.5.9 # via tox-ansible (pyproject.toml)
pygments==2.18.0 # via mkdocs-material
pylint==3.3.1 # via tox-ansible (pyproject.toml)
pymdown-extensions==10.12 # via markdown-exec, mkdocs-ansible, mkdocs-material, mkdocstrings
pyproject-api==1.8.0 # via tox
pytest==8.3.3 # via pytest-ansible, pytest-xdist, tox-ansible (pyproject.toml)
pytest-ansible==24.9.0 # via tox-ansible (pyproject.toml)
pytest-xdist==3.6.1 # via tox-ansible (pyproject.toml)
python-dateutil==2.9.0.post0 # via ghp-import, mkdocs-macros-plugin
python-slugify==8.0.4 # via mkdocs-monorepo-plugin
pyyaml==6.0.2 # via ansible-compat, ansible-core, mkdocs, mkdocs-get-deps, mkdocs-macros-plugin, pre-commit, pymdown-extensions, pyyaml-env-tag, tox-ansible (pyproject.toml)
pyyaml-env-tag==0.1 # via mkdocs
referencing==0.35.1 # via jsonschema, jsonschema-specifications
regex==2024.11.6 # via mkdocs-material
requests==2.32.3 # via linkchecker, mkdocs-htmlproofer-plugin, mkdocs-material
rpds-py==0.21.0 # via jsonschema, referencing
ruff==0.7.2 # via tox-ansible (pyproject.toml)
six==1.16.0 # via python-dateutil
soupsieve==2.6 # via beautifulsoup4
subprocess-tee==0.4.2 # via ansible-compat
super-collections==0.5.3 # via mkdocs-macros-plugin
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.23.1 # via tox-ansible (pyproject.toml)
tomli==2.0.2 # via black, coverage, mypy, pydoclint, pylint, pyproject-api, pytest, tox
tomlkit==0.13.2 # via pylint, toml-sort
tox==4.23.2 # via tox-ansible (pyproject.toml)
types-pyyaml==6.0.12.20240917 # via tox-ansible (pyproject.toml)
urllib3==2.2.3 # via requests
virtualenv==20.27.1 # via pre-commit, tox
watchdog==6.0.0 # via mkdocs
webencodings==0.5.1 # via cssselect2, tinycss2

# The following packages are considered to be unsafe in a requirements file:
# The following packages were excluded from the output:
# ansible-core
# pip
# setuptools
# resolvelib
# typing-extensions
1 change: 0 additions & 1 deletion .config/requirements-test.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ ansible-core
black
coverage[toml]
mypy
pip-tools
pre-commit
pydoclint
pylint
Expand Down
40 changes: 23 additions & 17 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ ci:
autoupdate_schedule: monthly
autofix_commit_msg: "chore: auto fixes from pre-commit.com hooks"

skip:
- deps
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
Expand Down Expand Up @@ -66,7 +68,7 @@ repos:
- --exit-non-zero-on-fix

- repo: https://github.com/streetsidesoftware/cspell-cli
rev: v8.15.2
rev: v8.15.3
hooks:
- id: cspell
name: Spell check with cspell
Expand Down Expand Up @@ -101,20 +103,24 @@ repos:
# Override default pre-commit '--ignore-missing-imports'
args: [--strict]

- repo: https://github.com/jazzband/pip-tools
rev: 7.4.1
# Keep last due to being considerably slower than the others:
- repo: local
hooks:
- id: pip-compile
name: deps
alias: deps
stages: [manual]
entry: >-
pip-compile .config/requirements.in
--no-annotate
--upgrade
--all-extras
--no-annotate
--strip-extras
--output-file=.config/constraints.txt pyproject.toml
files: ^.config\/.*requirements.*$
language_version: "3.10" # minimal we support officially
- id: up
name: Upgrade constraints files and requirements
files: ^(pyproject\.toml|requirements\.txt)$
language: python
entry: python3 -m uv pip compile --python-version=3.10 -q --all-extras --output-file=.config/constraints.txt pyproject.toml --upgrade
pass_filenames: false
stages:
- manual
additional_dependencies:
- uv>=0.4.3
- id: deps
name: Check constraints files and requirements
files: ^(pyproject\.toml|requirements\.txt)$
language: python
entry: python3 -m uv pip compile --python-version=3.10 -q --all-extras --output-file=.config/constraints.txt pyproject.toml
pass_filenames: false
additional_dependencies:
- uv>=0.4.3
8 changes: 7 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ allow-init-docstring = true
arg-type-hints-in-docstring = false
baseline = ".config/pydoclint-baseline.txt"
check-return-types = false
exclude = '\.git|\.tox|build|out|venv'
exclude = '\.eggs|\.git|\.tox|build|out|venv'
should-document-private-class-attributes = true
show-filenames-in-every-violation-message = true
skip-checking-short-docstrings = false
Expand Down Expand Up @@ -375,3 +375,9 @@ write_to = "src/tox_ansible/_version.py"
in_place = true
sort_inline_tables = true
sort_table_keys = true

[tool.uv.pip]
annotation-style = "line"
custom-compile-command = "tox run deps"
no-emit-package = ["ansible-core", "pip", "resolvelib", "typing_extensions", "uv"]
#python-version = "3.10"
5 changes: 3 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[tox]
requires =
tox>=4.11.3
tox-uv
env_list =
py
deps
Expand Down Expand Up @@ -49,7 +50,6 @@ allowlist_externals =

[testenv:deps]
description = Bump all dependencies
base_python = python3.10
skip_install = true
deps =
{[testenv:lint]deps}
Expand All @@ -58,7 +58,7 @@ set_env =
PIP_CONSTRAINT = /dev/null
commands_pre =
commands =
-pre-commit run --all-files --show-diff-on-failure --hook-stage manual deps
-pre-commit run --all-files --show-diff-on-failure --hook-stage manual up
-pre-commit autoupdate
git diff --exit-code
env_dir = {toxworkdir}/lint
Expand All @@ -80,6 +80,7 @@ description = Enforce quality standards under {basepython}
skip_install = true
deps =
pre-commit
pre-commit-uv
set_env =
PIP_CONSTRAINT = /dev/null
commands =
Expand Down

0 comments on commit c09175c

Please sign in to comment.