Skip to content

Constraint python dependencies to ensure reproducible test results #1937

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 17, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
123 changes: 123 additions & 0 deletions .config/constraints.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
# This file was autogenerated by uv via the following command:
# task -e deps
ansible-builder==3.1.0
ansible-compat==25.1.5
ansible-lint==25.1.3
ansible-navigator==25.4.0
ansible-runner==2.4.1
argparse-manpage==4.6
attrs==25.3.0
babel==2.17.0
backrefs==5.8
beautifulsoup4==4.13.4
bindep==2.13.0
black==25.1.0
bracex==2.5.post1
cairocffi==1.7.1
cairosvg==2.7.1
certifi==2025.1.31
cffi==1.17.1
cfgv==3.4.0
charset-normalizer==3.4.1
click==8.1.8
colorama==0.4.6
cryptography==44.0.2
csscompressor==0.9.5
cssselect2==0.8.0
cython==3.0.12
dacite==1.9.2
defusedxml==0.7.1
distlib==0.3.9
distro==1.9.0
dnspython==2.7.0
filelock==3.18.0
ghp-import==2.1.0
gitdb==4.0.12
gitpython==3.1.44
griffe==1.7.2
hjson==3.1.0
htmlmin2==0.1.13
identify==2.6.9
idna==3.10
importlib-metadata==8.6.1
jinja2==3.1.6
jsmin==3.0.1
jsonschema==4.23.0
jsonschema-specifications==2024.10.1
linkchecker==10.5.0
lockfile==0.12.2
markdown==3.8
markdown-exec==1.10.3
markdown-include==0.8.1
markupsafe==3.0.2
mergedeep==1.3.4
mkdocs==1.6.1
mkdocs-ansible==25.2.0
mkdocs-autorefs==1.4.1
mkdocs-exclude==1.0.2
mkdocs-gen-files==0.5.0
mkdocs-get-deps==0.2.0
mkdocs-git-revision-date-localized-plugin==1.4.5
mkdocs-htmlproofer-plugin==1.3.0
mkdocs-macros-plugin==1.3.7
mkdocs-material==9.6.12
mkdocs-material-extensions==1.3.1
mkdocs-minify-plugin==0.8.0
mkdocs-monorepo-plugin==1.1.0
mkdocs-multirepo-plugin==0.8.3
mkdocstrings==0.29.1
mkdocstrings-python==1.16.10
mypy==1.15.0
mypy-extensions==1.0.0
nodeenv==1.9.1
onigurumacffi==1.4.1
packaging==24.2
paginate==0.5.7
parsley==1.3
pathspec==0.12.1
pbr==6.1.1
pexpect==4.9.0
pillow==11.2.1
platformdirs==4.3.7
pre-commit==4.2.0
pre-commit-uv==4.1.4
ptyprocess==0.7.0
pycparser==2.22
pygments==2.19.1
pymdown-extensions==10.14.3
python-daemon==3.1.2
python-dateutil==2.9.0.post0
python-slugify==8.0.4
pytz==2025.2
pyyaml==6.0.2
pyyaml-env-tag==0.1
referencing==0.36.2
requests==2.32.3
rpds-py==0.24.0
ruamel-yaml==0.18.10
six==1.17.0
slugify==0.0.1
smmap==5.0.2
soupsieve==2.6
subprocess-tee==0.4.2
super-collections==0.5.3
termcolor==3.0.1
text-unidecode==1.3
tinycss2==1.4.0
typing-inspect==0.8.0
tzdata==2025.2
urllib3==2.4.0
virtualenv==20.30.0
watchdog==6.0.0
wcmatch==10.0
webencodings==0.5.1
yamllint==1.37.0
zipp==3.21.0

# The following packages were excluded from the output:
# ansible-core
# pip
# resolvelib
# typing-extensions
# setuptools
# uv
1 change: 0 additions & 1 deletion .config/requirements.in
Original file line number Diff line number Diff line change
@@ -4,7 +4,6 @@ ansible-lint>=6.8.7
ansible-navigator
mypy # used by vscode
pip>=22.3.1
pip-tools>=6.12.1
pre-commit>=4.0.1
pre-commit-uv>=4.1.4
# docs
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
version: 2
updates:
- package-ecosystem: pip
directory: /.config/
schedule:
day: sunday
interval: weekly
labels:
- dependabot-deps-updates
- skip-changelog
groups:
dependencies:
patterns:
- "*"
- package-ecosystem: npm
directories:
- "/"
55 changes: 30 additions & 25 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -149,10 +149,38 @@ jobs:

- name: Setup node.js
if: ${{ !contains(matrix.shell, 'wsl') }}
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4
uses: actions/setup-node@v4.4.0
with:
node-version: 20
cache: yarn
# yarn cache is broken due https://github.com/actions/setup-node/issues/531
# cache: yarn

- name: Corepack enable
if: ${{ !contains(matrix.shell, 'wsl') }}
run: corepack enable

- name: Enable caching
uses: actions/cache@v4
with:
path: |
.vscode-test
.yarn/cache
out/ext
out/test-resources
out/test-resources-oldest
~/.cache/pip
~/.cache/yarn
~/.cache/pre-commit/
key: ${{ runner.os }}-${{ matrix.task-name }}-${{ hashFiles('package.json', 'yarn.lock', '.config/requirements.txt', 'tools/*.*') }}

# - name: Enable caching for podman-machine
# if: "contains(matrix.os, 'macos')"
# uses: actions/cache@v4
# with:
# path: |
# ~/.local/share/containers
# ~/.config/containers
# key: ${{ runner.os }}-${{ matrix.task-name }}-${{ hashFiles('package.json', 'yarn.lock', '.config/requirements.txt', '**/Taskfile.yml', 'tools/*.*') }}

- name: Setup task
if: ${{ !contains(matrix.shell, 'wsl') }}
@@ -223,29 +251,6 @@ jobs:
# Ensure NODE_OPTIONS config on CI is identical with the one in .env
[[ "${NODE_OPTIONS:-}" == "$(direnv exec . printenv NODE_OPTIONS)" ]] || { echo "NODE_OPTIONS mismatch between .env and ci.yaml"; exit 97; }

- name: Enable caching
uses: actions/cache@v4
with:
path: |
.vscode-test
.yarn/cache
out/ext
out/test-resources
out/test-resources-oldest
~/.cache/pip
~/.cache/yarn
~/.cache/pre-commit/
key: ${{ runner.os }}-${{ matrix.task-name }}-${{ hashFiles('package.json', 'yarn.lock', '.config/requirements.txt', 'tools/*.*') }}

# - name: Enable caching for podman-machine
# if: "contains(matrix.os, 'macos')"
# uses: actions/cache@v4
# with:
# path: |
# ~/.local/share/containers
# ~/.config/containers
# key: ${{ runner.os }}-${{ matrix.task-name }}-${{ hashFiles('package.json', 'yarn.lock', '.config/requirements.txt', '**/Taskfile.yml', 'tools/*.*') }}

- name: Install dependencies
uses: backstage/actions/yarn-install@b3c1841fd69e1658ac631afafd0fb140a2309024 # v0.6.17
with:
1 change: 1 addition & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
@@ -84,6 +84,7 @@ tasks:
VSCODE_VERSION:
sh: node -p "require('./package.json').engines.vscode"
cmds:
- uv pip compile -q --universal --no-annotate --output-file .config/constraints.txt .config/requirements.in
- task: install
# upgrade yarn itself
- yarn set version latest
9 changes: 5 additions & 4 deletions cspell.config.yaml
Original file line number Diff line number Diff line change
@@ -13,13 +13,14 @@ dictionaries:
- "!cryptocurrencies"
- "!cpp"
ignorePaths:
- syntaxes/external/*.*
- "**/requirements.in"
- .config/constraints.txt
- .yarn/
- media
- package.json
- test/testFixtures/lightspeed/*.yml
- .yarn/
- "**/requirements.in"
- syntaxes
- syntaxes/external/*.*
- test/testFixtures/lightspeed/*.yml
ignoreRegExpList:
# ignore github usernames like @foo
- "@[\\w]+"
14 changes: 0 additions & 14 deletions packages/ansible-language-server/.config/requirements.in

This file was deleted.

16 changes: 16 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -35,3 +35,19 @@ exclude = ["examples"]
fix = true
line-length = 100
target-version = "py310"

[tool.uv.pip]
no-emit-package = [
"ansible-core",
"exceptiongroup", # <py311
"pip",
"resolvelib",
"ruamel-yaml-clib",
"tomli", # <py311
"typing-extensions",
"setuptools",
"wheel",
"uv"
]
annotation-style = "line"
custom-compile-command = "task -e deps"
2 changes: 1 addition & 1 deletion tools/test-setup.sh
Original file line number Diff line number Diff line change
@@ -283,7 +283,7 @@ if [[ $(uname || true) != MINGW* ]]; then # if we are not on pure Windows
# to avoid surprises. This ensures venv and community-ansible-dev-tools EE have exactly same
# versions.
python3 -m uv pip install -q \
-r .config/requirements.in
-r .config/requirements.in -c .config/constraints.txt
fi

# GHA failsafe only: ensure ansible and ansible-lint cannot be found anywhere
Loading
Oops, something went wrong.