Skip to content

Commit 6c14643

Browse files
authored
Replace pip-compile with uv pip compile (#500)
1 parent e8c40f0 commit 6c14643

File tree

4 files changed

+67
-79
lines changed

4 files changed

+67
-79
lines changed

.config/constraints.txt

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
1-
#
2-
# This file is autogenerated by pip-compile with Python 3.10
3-
# by the following command:
4-
#
5-
# pip-compile --all-extras --no-annotate --output-file=.config/constraints.txt --strip-extras --unsafe-package=ansible-dev-tools --unsafe-package=distribute --unsafe-package=pip --unsafe-package=setuptools .config/requirements.in pyproject.toml
6-
#
1+
# This file was autogenerated by uv via the following command:
2+
# tox run deps
73
ansible-builder==3.1.0
8-
ansible-compat>=24.10.0
9-
ansible-core==2.17.6
4+
ansible-compat==24.10.0
105
ansible-creator==24.12.0
116
ansible-dev-environment==24.12.0
127
ansible-lint==24.12.2
@@ -25,7 +20,7 @@ build==1.2.2.post1
2520
cachetools==5.5.0
2621
cairocffi==1.7.1
2722
cairosvg==2.7.1
28-
certifi==2024.8.30
23+
certifi==2024.12.14
2924
cffi==1.17.1
3025
cfgv==3.4.0
3126
chardet==5.2.0
@@ -46,7 +41,6 @@ django-stubs==5.1.1
4641
django-stubs-ext==5.1.1
4742
dnspython==2.7.0
4843
docstring-parser-fork==0.0.9
49-
docutils==0.21.2
5044
enrich==1.2.7
5145
exceptiongroup==1.2.2
5246
execnet==2.1.1
@@ -86,7 +80,7 @@ mkdocs-gen-files==0.5.0
8680
mkdocs-get-deps==0.2.0
8781
mkdocs-htmlproofer-plugin==1.3.0
8882
mkdocs-macros-plugin==1.3.7
89-
mkdocs-material==9.5.48
83+
mkdocs-material==9.5.49
9084
mkdocs-material-extensions==1.3.1
9185
mkdocs-minify-plugin==0.8.0
9286
mkdocs-monorepo-plugin==1.1.0
@@ -111,20 +105,20 @@ pbr==6.1.0
111105
pexpect==4.9.0
112106
pillow==11.0.0
113107
pip-tools==7.4.1
114-
pipdeptree==2.24.0
115108
platformdirs==4.3.6
116109
pluggy==1.5.0
117110
pre-commit==4.0.1
118111
ptyprocess==0.7.0
119112
pycparser==2.22
120-
pydoclint==0.5.10
113+
pydoclint==0.5.12
121114
pygments==2.18.0
122115
pylint==3.3.2
123116
pymdown-extensions==10.12
124117
pyproject-api==1.8.0
125118
pyproject-hooks==1.2.0
126119
pytest==8.3.4
127120
pytest-ansible==24.12.0
121+
pytest-instafail==0.5.0
128122
pytest-xdist==3.6.1
129123
python-daemon==3.1.2
130124
python-dateutil==2.9.0.post0
@@ -135,16 +129,15 @@ pyyaml-env-tag==0.1
135129
referencing==0.31.1
136130
regex==2024.11.6
137131
requests==2.32.3
138-
resolvelib==1.0.1
139132
rfc3339-validator==0.1.4
140133
rich==13.9.4
141134
rpds-py==0.22.3
142135
ruamel-yaml==0.18.6
143136
ruamel-yaml-clib==0.2.12
144-
ruff==0.8.2
137+
ruff==0.8.3
145138
six==1.17.0
146139
soupsieve==2.6
147-
sqlparse==0.5.2
140+
sqlparse==0.5.3
148141
subprocess-tee==0.4.2
149142
super-collections==0.5.3
150143
termcolor==2.5.0
@@ -157,7 +150,6 @@ tox==4.23.2
157150
tox-ansible==24.12.0
158151
types-pyyaml==6.0.12.20240917
159152
types-requests==2.32.0.20241016
160-
typing-extensions==4.12.2
161153
tzdata==2024.2
162154
urllib3==2.2.3
163155
virtualenv==20.28.0
@@ -169,7 +161,10 @@ wheel==0.45.1
169161
yamllint==1.35.1
170162
zipp==3.21.0
171163

172-
# The following packages are considered to be unsafe in a requirements file:
173-
# ansible-dev-tools
164+
# The following packages were excluded from the output:
165+
# ansible-core
166+
# pip
167+
# resolvelib
168+
# typing-extensions
174169
# pip
175170
# setuptools

.config/requirements-lock.txt

Lines changed: 7 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,44 @@
1-
#
2-
# This file is autogenerated by pip-compile with Python 3.10
3-
# by the following command:
4-
#
5-
# pip-compile --constraint=.config/constraints.txt --extra=server --no-annotate --output-file=.config/requirements-lock.txt --strip-extras --unsafe-package=distribute --unsafe-package=pip --unsafe-package=setuptools .config/requirements.in pyproject.toml
6-
#
1+
# This file was autogenerated by uv via the following command:
2+
# tox run deps
73
ansible-builder==3.1.0
8-
ansible-compat>=24.10.0
9-
ansible-core==2.17.6
4+
ansible-compat==24.10.0
105
ansible-creator==24.12.0
116
ansible-dev-environment==24.12.0
127
ansible-lint==24.12.2
138
ansible-navigator==24.12.0
149
ansible-runner==2.4.0
1510
ansible-sign==0.1.1
16-
asgiref==3.8.1
1711
attrs==24.2.0
1812
bindep==2.11.0
1913
black==24.10.0
2014
bracex==2.5.post1
2115
cachetools==5.5.0
22-
certifi==2024.8.30
2316
cffi==1.17.1
2417
chardet==5.2.0
25-
charset-normalizer==3.4.0
2618
click==8.1.7
2719
click-help-colors==0.9.4
2820
colorama==0.4.6
2921
cryptography==44.0.0
3022
distlib==0.3.9
3123
distro==1.9.0
32-
django==5.1.4
3324
enrich==1.2.7
3425
exceptiongroup==1.2.2
3526
execnet==2.1.1
3627
filelock==3.16.1
37-
gunicorn==23.0.0
38-
idna==3.10
3928
importlib-metadata==8.5.0
4029
iniconfig==2.0.0
41-
isodate==0.7.2
4230
jinja2==3.1.4
4331
jsonschema==4.23.0
44-
jsonschema-path==0.3.3
4532
jsonschema-specifications==2023.12.1
46-
lazy-object-proxy==1.10.0
4733
lockfile==0.12.2
4834
markdown-it-py==3.0.0
4935
markupsafe==3.0.2
5036
mdurl==0.1.2
5137
molecule==24.12.0
52-
more-itertools==10.5.0
5338
mypy-extensions==1.0.0
5439
onigurumacffi==1.3.0
55-
openapi-core==0.19.4
56-
openapi-schema-validator==0.6.2
57-
openapi-spec-validator==0.7.1
5840
packaging==24.2
59-
parse==1.20.2
6041
parsley==1.3
61-
pathable==0.4.3
6242
pathspec==0.12.1
6343
pbr==6.1.0
6444
pexpect==4.9.0
@@ -75,27 +55,22 @@ python-daemon==3.1.2
7555
python-gnupg==0.5.3
7656
pyyaml==6.0.2
7757
referencing==0.31.1
78-
requests==2.32.3
79-
resolvelib==1.0.1
80-
rfc3339-validator==0.1.4
8158
rich==13.9.4
8259
rpds-py==0.22.3
8360
ruamel-yaml==0.18.6
8461
ruamel-yaml-clib==0.2.12
85-
six==1.17.0
86-
sqlparse==0.5.2
8762
subprocess-tee==0.4.2
8863
tomli==2.2.1
8964
tox==4.23.2
9065
tox-ansible==24.12.0
91-
typing-extensions==4.12.2
9266
tzdata==2024.2
93-
urllib3==2.2.3
9467
virtualenv==20.28.0
9568
wcmatch==10.0
96-
werkzeug==3.1.3
9769
yamllint==1.35.1
9870
zipp==3.21.0
9971

100-
# The following packages are considered to be unsafe in a requirements file:
72+
# The following packages were excluded from the output:
73+
# ansible-core
74+
# resolvelib
75+
# typing-extensions
10176
# setuptools

.pre-commit-config.yaml

Lines changed: 36 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ ci:
66
autofix_commit_msg: "chore: auto fixes from pre-commit.com hooks"
77
skip:
88
- shellcheck # no docker support on pre-commit.ci
9+
- deps
10+
- constraints
11+
- lock
912
default_language_version:
1013
# minimal version we support officially as this will impact mypy, pylint and
1114
# pip-tools in undesirable ways.
@@ -48,7 +51,7 @@ repos:
4851
- id: shellcheck
4952

5053
- repo: https://github.com/pycontribs/mirrors-prettier
51-
rev: v3.3.3
54+
rev: v3.4.2
5255
hooks:
5356
- id: prettier
5457
always_run: true
@@ -68,7 +71,7 @@ repos:
6871
- id: tox-ini-fmt
6972

7073
- repo: https://github.com/astral-sh/ruff-pre-commit
71-
rev: v0.8.1
74+
rev: v0.8.3
7275
hooks:
7376
- id: ruff
7477
args:
@@ -84,7 +87,7 @@ repos:
8487
- id: black
8588

8689
- repo: https://github.com/streetsidesoftware/cspell-cli
87-
rev: v8.16.0
90+
rev: v8.16.1
8891
hooks:
8992
- id: cspell
9093
name: Spell check with cspell
@@ -131,34 +134,39 @@ repos:
131134
# Override default pre-commit '--ignore-missing-imports'
132135
args: [--strict]
133136

134-
- repo: https://github.com/jazzband/pip-tools
135-
rev: 7.4.1
137+
- # keep at bottom as these are slower
138+
repo: local
136139
hooks:
137-
- id: pip-compile
138-
name: deps
140+
- id: deps
139141
alias: deps
140-
stages: [manual]
141-
# The manual unsafe packages below are b/c of the test extras dep on the server extras
142-
# which should not pull in the src pkg
143-
entry: |
144-
pip-compile .config/requirements.in -q --upgrade --all-extras --no-annotate --strip-extras
145-
--unsafe-package ansible-dev-tools
146-
--unsafe-package distribute
147-
--unsafe-package pip
148-
--unsafe-package setuptools
149-
--output-file=.config/constraints.txt pyproject.toml
150-
files: ^.config\/.*requirements.*$
142+
name: Upgrade constraints files and requirements
143+
# files: ^(pyproject\.toml|requirements\.txt)$
144+
language: python
145+
language_version: "3.10" # minimal we support officially
146+
entry: python3 -m uv pip compile -q --all-extras --output-file=.config/constraints.txt pyproject.toml --upgrade
147+
pass_filenames: false
148+
stages:
149+
- manual
150+
additional_dependencies:
151+
- uv>=0.4.3
152+
- id: constraints
153+
name: Check constraints files and requirements
154+
# files: ^(pyproject\.toml|requirements\.txt)$
155+
language: python
151156
language_version: "3.10" # minimal we support officially
152-
- id: pip-compile
153-
name: lock
157+
entry: python3 -m uv pip compile -q --all-extras --output-file=.config/constraints.txt pyproject.toml
158+
pass_filenames: false
159+
additional_dependencies:
160+
- uv>=0.4.3
161+
- id: lock
162+
name: Update requirements-lock.txt
154163
alias: lock
155-
stages: [manual]
156-
entry: |
157-
pip-compile .config/requirements.in -q --upgrade --extra server --no-annotate --strip-extras
158-
--constraint=.config/constraints.txt
159-
--unsafe-package distribute
160-
--unsafe-package pip
161-
--unsafe-package setuptools
162-
--output-file=.config/requirements-lock.txt pyproject.toml
164+
always_run: true
165+
entry: python3 -m uv pip compile -q --upgrade --constraint=.config/constraints.txt --output-file=.config/requirements-lock.txt pyproject.toml --strip-extras
163166
files: ^.config\/.*requirements.*$
167+
language: python
164168
language_version: "3.10" # minimal we support officially
169+
pass_filenames: false
170+
stages: [manual]
171+
additional_dependencies:
172+
- uv>=0.4.3

pyproject.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,3 +392,13 @@ write_to = "src/ansible_dev_tools/_version.py"
392392
in_place = true
393393
sort_inline_tables = true
394394
sort_table_keys = true
395+
396+
[tool.uv]
397+
# incompatible with Windows
398+
environments = ["platform_system != 'Windows'"]
399+
400+
[tool.uv.pip]
401+
# annotation-style = "line"
402+
custom-compile-command = "tox run deps"
403+
no-annotate = true
404+
no-emit-package = ["ansible-core", "pip", "resolvelib", "typing_extensions", "uv", "pip", "distribute", "setuptools"]

0 commit comments

Comments
 (0)