Skip to content

Commit f547cfb

Browse files
authored
Update dependency testing (#528)
Fixes a problem that prevented their update because 'lock' dependency was included when the "deps" hook did run, preventing their update.
1 parent 1463247 commit f547cfb

File tree

5 files changed

+23
-45
lines changed

5 files changed

+23
-45
lines changed

.config/constraints.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ text-unidecode==1.3
142142
tinycss2==1.4.0
143143
toml-sort==0.24.2
144144
tomlkit==0.13.2
145-
tox==4.23.2
145+
tox==4.24.1
146146
tox-ansible==25.1.0
147147
types-pyyaml==6.0.12.20241230
148148
types-requests==2.32.0.20241016

.config/requirements-lock.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ rpds-py==0.22.3
6060
ruamel-yaml==0.18.6
6161
ruamel-yaml-clib==0.2.12
6262
subprocess-tee==0.4.2
63-
tox==4.23.2
63+
tox==4.24.1
6464
tox-ansible==25.1.0
6565
tzdata==2024.2
6666
virtualenv==20.28.0

.pre-commit-config.yaml

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ ci:
77
skip:
88
- shellcheck # no docker support on pre-commit.ci
99
- deps
10-
- constraints
11-
- lock
1210
default_language_version:
1311
# minimal version we support officially as this will impact mypy, pylint and
1412
# pip-tools in undesirable ways.
@@ -65,12 +63,12 @@ repos:
6563
- id: toml-sort-fix
6664

6765
- repo: https://github.com/tox-dev/tox-ini-fmt
68-
rev: 1.4.1
66+
rev: 1.5.0
6967
hooks:
7068
- id: tox-ini-fmt
7169

7270
- repo: https://github.com/astral-sh/ruff-pre-commit
73-
rev: v0.9.2
71+
rev: v0.9.3
7472
hooks:
7573
- id: ruff
7674
args:
@@ -137,30 +135,14 @@ repos:
137135
# files: ^(pyproject\.toml|requirements\.txt)$
138136
language: python
139137
language_version: "3.11" # minimal required by latest ansible-core
140-
entry: python3 -m uv pip compile -q --all-extras --output-file=.config/constraints.txt pyproject.toml --upgrade
138+
# do not use --all-extra because it will include the lock extra which prevents upgrade
139+
entry: >
140+
bash -c
141+
"python3 -m uv pip compile --upgrade -q --extra docs --extra server --extra test --output-file=.config/constraints.txt pyproject.toml;
142+
python3 -m uv pip compile -q --upgrade --constraint=.config/constraints.txt --output-file=.config/requirements-lock.txt pyproject.toml --strip-extras
143+
"
141144
pass_filenames: false
142145
stages:
143146
- manual
144147
additional_dependencies:
145-
- uv>=0.4.3
146-
- id: constraints
147-
name: Check constraints files and requirements
148-
# files: ^(pyproject\.toml|requirements\.txt)$
149-
language: python
150-
language_version: "3.11" # minimal required by latest ansible-core
151-
entry: python3 -m uv pip compile -q --all-extras --output-file=.config/constraints.txt pyproject.toml
152-
pass_filenames: false
153-
additional_dependencies:
154-
- uv>=0.4.3
155-
- id: lock
156-
name: Update requirements-lock.txt
157-
alias: lock
158-
always_run: true
159-
entry: python3 -m uv pip compile -q --upgrade --constraint=.config/constraints.txt --output-file=.config/requirements-lock.txt pyproject.toml --strip-extras
160-
files: ^.config\/.*requirements.*$
161-
language: python
162-
language_version: "3.11" # minimal required by latest ansible-core
163-
pass_filenames: false
164-
stages: [manual]
165-
additional_dependencies:
166-
- uv>=0.4.3
148+
- uv>=0.5.4

tools/devspaces.sh

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,17 @@ IMAGE_NAME=ansible/ansible-workspace-env-reference:test
77
mkdir -p out dist
88
# Ensure that we packaged the code first
99
# shellcheck disable=SC2207
10+
rm -f dist/*.*
11+
tox -e pkg
12+
# shellcheck disable=SC2207
1013
WHEELS=($(find dist -name '*.whl' -maxdepth 1 -execdir echo '{}' ';'))
1114
if [ ${#WHEELS[@]} -ne 1 ]; then
12-
tox -e pkg
13-
# shellcheck disable=SC2207
14-
WHEELS=($(find dist -name '*.whl' -maxdepth 1 -execdir echo '{}' ';'))
15-
if [ ${#WHEELS[@]} -ne 1 ]; then
16-
echo "Unable to find a single wheel file in dist/ directory: ${WHEELS[*]}"
17-
exit 2
18-
fi
15+
echo "Unable to find a single wheel file in dist/ directory: ${WHEELS[*]}"
16+
exit 2
1917
fi
2018
rm -f devspaces/context/*.whl
21-
cp dist/*.whl devspaces/context
22-
cp tools/setup-image.sh devspaces/context
19+
ln -f dist/*.whl devspaces/context
20+
ln -f tools/setup-image.sh devspaces/context
2321

2422
# we force use of linux/amd64 platform because source image supports only this
2523
# platform and without it, it will fail to cross-build when task runs on arm64.

tox.ini

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[tox]
22
requires =
3-
tox>=4.11.3
4-
tox-extra>=2.0.2
5-
tox-uv>=1.19
3+
tox>=4.24.1
4+
tox-extra>=2.1
5+
tox-uv>=1.20.1
66
env_list =
77
py
88
deps
@@ -79,9 +79,7 @@ extras =
7979
commands_pre =
8080
commands =
8181
-pre-commit run --all-files --show-diff-on-failure --hook-stage manual deps
82-
-pre-commit run --all-files --show-diff-on-failure --hook-stage manual lock
8382
-pre-commit autoupdate
84-
git diff --exit-code
8583
env_dir = {toxworkdir}/lint
8684

8785
[testenv:docs]
@@ -100,8 +98,8 @@ commands =
10098
description = Enforce quality standards under {basepython}
10199
skip_install = true
102100
deps =
103-
pre-commit
104-
pre-commit-uv
101+
pre-commit>=4.1
102+
pre-commit-uv>=4.1.4
105103
commands =
106104
pre-commit run --show-diff-on-failure --all-files
107105

0 commit comments

Comments
 (0)