Skip to content

Commit ac1f604

Browse files
authored
Constraint python dependencies to ensure reproducible test results (#1937)
1 parent 7b7bf7d commit ac1f604

File tree

9 files changed

+188
-45
lines changed

9 files changed

+188
-45
lines changed

.config/constraints.txt

+123
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
# This file was autogenerated by uv via the following command:
2+
# task -e deps
3+
ansible-builder==3.1.0
4+
ansible-compat==25.1.5
5+
ansible-lint==25.1.3
6+
ansible-navigator==25.4.0
7+
ansible-runner==2.4.1
8+
argparse-manpage==4.6
9+
attrs==25.3.0
10+
babel==2.17.0
11+
backrefs==5.8
12+
beautifulsoup4==4.13.4
13+
bindep==2.13.0
14+
black==25.1.0
15+
bracex==2.5.post1
16+
cairocffi==1.7.1
17+
cairosvg==2.7.1
18+
certifi==2025.1.31
19+
cffi==1.17.1
20+
cfgv==3.4.0
21+
charset-normalizer==3.4.1
22+
click==8.1.8
23+
colorama==0.4.6
24+
cryptography==44.0.2
25+
csscompressor==0.9.5
26+
cssselect2==0.8.0
27+
cython==3.0.12
28+
dacite==1.9.2
29+
defusedxml==0.7.1
30+
distlib==0.3.9
31+
distro==1.9.0
32+
dnspython==2.7.0
33+
filelock==3.18.0
34+
ghp-import==2.1.0
35+
gitdb==4.0.12
36+
gitpython==3.1.44
37+
griffe==1.7.2
38+
hjson==3.1.0
39+
htmlmin2==0.1.13
40+
identify==2.6.9
41+
idna==3.10
42+
importlib-metadata==8.6.1
43+
jinja2==3.1.6
44+
jsmin==3.0.1
45+
jsonschema==4.23.0
46+
jsonschema-specifications==2024.10.1
47+
linkchecker==10.5.0
48+
lockfile==0.12.2
49+
markdown==3.8
50+
markdown-exec==1.10.3
51+
markdown-include==0.8.1
52+
markupsafe==3.0.2
53+
mergedeep==1.3.4
54+
mkdocs==1.6.1
55+
mkdocs-ansible==25.2.0
56+
mkdocs-autorefs==1.4.1
57+
mkdocs-exclude==1.0.2
58+
mkdocs-gen-files==0.5.0
59+
mkdocs-get-deps==0.2.0
60+
mkdocs-git-revision-date-localized-plugin==1.4.5
61+
mkdocs-htmlproofer-plugin==1.3.0
62+
mkdocs-macros-plugin==1.3.7
63+
mkdocs-material==9.6.12
64+
mkdocs-material-extensions==1.3.1
65+
mkdocs-minify-plugin==0.8.0
66+
mkdocs-monorepo-plugin==1.1.0
67+
mkdocs-multirepo-plugin==0.8.3
68+
mkdocstrings==0.29.1
69+
mkdocstrings-python==1.16.10
70+
mypy==1.15.0
71+
mypy-extensions==1.0.0
72+
nodeenv==1.9.1
73+
onigurumacffi==1.4.1
74+
packaging==24.2
75+
paginate==0.5.7
76+
parsley==1.3
77+
pathspec==0.12.1
78+
pbr==6.1.1
79+
pexpect==4.9.0
80+
pillow==11.2.1
81+
platformdirs==4.3.7
82+
pre-commit==4.2.0
83+
pre-commit-uv==4.1.4
84+
ptyprocess==0.7.0
85+
pycparser==2.22
86+
pygments==2.19.1
87+
pymdown-extensions==10.14.3
88+
python-daemon==3.1.2
89+
python-dateutil==2.9.0.post0
90+
python-slugify==8.0.4
91+
pytz==2025.2
92+
pyyaml==6.0.2
93+
pyyaml-env-tag==0.1
94+
referencing==0.36.2
95+
requests==2.32.3
96+
rpds-py==0.24.0
97+
ruamel-yaml==0.18.10
98+
six==1.17.0
99+
slugify==0.0.1
100+
smmap==5.0.2
101+
soupsieve==2.6
102+
subprocess-tee==0.4.2
103+
super-collections==0.5.3
104+
termcolor==3.0.1
105+
text-unidecode==1.3
106+
tinycss2==1.4.0
107+
typing-inspect==0.8.0
108+
tzdata==2025.2
109+
urllib3==2.4.0
110+
virtualenv==20.30.0
111+
watchdog==6.0.0
112+
wcmatch==10.0
113+
webencodings==0.5.1
114+
yamllint==1.37.0
115+
zipp==3.21.0
116+
117+
# The following packages were excluded from the output:
118+
# ansible-core
119+
# pip
120+
# resolvelib
121+
# typing-extensions
122+
# setuptools
123+
# uv

.config/requirements.in

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ ansible-lint>=6.8.7
44
ansible-navigator
55
mypy # used by vscode
66
pip>=22.3.1
7-
pip-tools>=6.12.1
87
pre-commit>=4.0.1
98
pre-commit-uv>=4.1.4
109
# docs

.github/dependabot.yml

+12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
version: 2
22
updates:
3+
- package-ecosystem: pip
4+
directory: /.config/
5+
schedule:
6+
day: sunday
7+
interval: weekly
8+
labels:
9+
- dependabot-deps-updates
10+
- skip-changelog
11+
groups:
12+
dependencies:
13+
patterns:
14+
- "*"
315
- package-ecosystem: npm
416
directories:
517
- "/"

.github/workflows/ci.yaml

+30-25
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,38 @@ jobs:
149149

150150
- name: Setup node.js
151151
if: ${{ !contains(matrix.shell, 'wsl') }}
152-
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4
152+
uses: actions/setup-node@v4.4.0
153153
with:
154154
node-version: 20
155-
cache: yarn
155+
# yarn cache is broken due https://github.com/actions/setup-node/issues/531
156+
# cache: yarn
157+
158+
- name: Corepack enable
159+
if: ${{ !contains(matrix.shell, 'wsl') }}
160+
run: corepack enable
161+
162+
- name: Enable caching
163+
uses: actions/cache@v4
164+
with:
165+
path: |
166+
.vscode-test
167+
.yarn/cache
168+
out/ext
169+
out/test-resources
170+
out/test-resources-oldest
171+
~/.cache/pip
172+
~/.cache/yarn
173+
~/.cache/pre-commit/
174+
key: ${{ runner.os }}-${{ matrix.task-name }}-${{ hashFiles('package.json', 'yarn.lock', '.config/requirements.txt', 'tools/*.*') }}
175+
176+
# - name: Enable caching for podman-machine
177+
# if: "contains(matrix.os, 'macos')"
178+
# uses: actions/cache@v4
179+
# with:
180+
# path: |
181+
# ~/.local/share/containers
182+
# ~/.config/containers
183+
# key: ${{ runner.os }}-${{ matrix.task-name }}-${{ hashFiles('package.json', 'yarn.lock', '.config/requirements.txt', '**/Taskfile.yml', 'tools/*.*') }}
156184

157185
- name: Setup task
158186
if: ${{ !contains(matrix.shell, 'wsl') }}
@@ -223,29 +251,6 @@ jobs:
223251
# Ensure NODE_OPTIONS config on CI is identical with the one in .env
224252
[[ "${NODE_OPTIONS:-}" == "$(direnv exec . printenv NODE_OPTIONS)" ]] || { echo "NODE_OPTIONS mismatch between .env and ci.yaml"; exit 97; }
225253
226-
- name: Enable caching
227-
uses: actions/cache@v4
228-
with:
229-
path: |
230-
.vscode-test
231-
.yarn/cache
232-
out/ext
233-
out/test-resources
234-
out/test-resources-oldest
235-
~/.cache/pip
236-
~/.cache/yarn
237-
~/.cache/pre-commit/
238-
key: ${{ runner.os }}-${{ matrix.task-name }}-${{ hashFiles('package.json', 'yarn.lock', '.config/requirements.txt', 'tools/*.*') }}
239-
240-
# - name: Enable caching for podman-machine
241-
# if: "contains(matrix.os, 'macos')"
242-
# uses: actions/cache@v4
243-
# with:
244-
# path: |
245-
# ~/.local/share/containers
246-
# ~/.config/containers
247-
# key: ${{ runner.os }}-${{ matrix.task-name }}-${{ hashFiles('package.json', 'yarn.lock', '.config/requirements.txt', '**/Taskfile.yml', 'tools/*.*') }}
248-
249254
- name: Install dependencies
250255
uses: backstage/actions/yarn-install@b3c1841fd69e1658ac631afafd0fb140a2309024 # v0.6.17
251256
with:

Taskfile.yml

+1
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ tasks:
8484
VSCODE_VERSION:
8585
sh: node -p "require('./package.json').engines.vscode"
8686
cmds:
87+
- uv pip compile -q --universal --no-annotate --output-file .config/constraints.txt .config/requirements.in
8788
- task: install
8889
# upgrade yarn itself
8990
- yarn set version latest

cspell.config.yaml

+5-4
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,14 @@ dictionaries:
1313
- "!cryptocurrencies"
1414
- "!cpp"
1515
ignorePaths:
16-
- syntaxes/external/*.*
16+
- "**/requirements.in"
17+
- .config/constraints.txt
18+
- .yarn/
1719
- media
1820
- package.json
19-
- test/testFixtures/lightspeed/*.yml
20-
- .yarn/
21-
- "**/requirements.in"
2221
- syntaxes
22+
- syntaxes/external/*.*
23+
- test/testFixtures/lightspeed/*.yml
2324
ignoreRegExpList:
2425
# ignore github usernames like @foo
2526
- "@[\\w]+"

packages/ansible-language-server/.config/requirements.in

-14
This file was deleted.

pyproject.toml

+16
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,19 @@ exclude = ["examples"]
3535
fix = true
3636
line-length = 100
3737
target-version = "py310"
38+
39+
[tool.uv.pip]
40+
no-emit-package = [
41+
"ansible-core",
42+
"exceptiongroup", # <py311
43+
"pip",
44+
"resolvelib",
45+
"ruamel-yaml-clib",
46+
"tomli", # <py311
47+
"typing-extensions",
48+
"setuptools",
49+
"wheel",
50+
"uv"
51+
]
52+
annotation-style = "line"
53+
custom-compile-command = "task -e deps"

tools/test-setup.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ if [[ $(uname || true) != MINGW* ]]; then # if we are not on pure Windows
283283
# to avoid surprises. This ensures venv and community-ansible-dev-tools EE have exactly same
284284
# versions.
285285
python3 -m uv pip install -q \
286-
-r .config/requirements.in
286+
-r .config/requirements.in -c .config/constraints.txt
287287
fi
288288

289289
# GHA failsafe only: ensure ansible and ansible-lint cannot be found anywhere

0 commit comments

Comments
 (0)