Skip to content
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

Add lower requirements and testing #4130

Merged
merged 1 commit into from
May 1, 2024
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions .config/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# 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 --unsafe-package=resolvelib --unsafe-package=ruamel-yaml-clib pyproject.toml
# pip-compile --all-extras --no-annotate --output-file=.config/constraints.txt --strip-extras --unsafe-package=resolvelib --unsafe-package=ruamel-yaml-clib --unsafe-package=wcmatch pyproject.toml
#
ansible-compat==4.1.11
ansible-core==2.16.6
Expand Down Expand Up @@ -108,10 +108,10 @@ types-pyyaml==6.0.12.20240311
typing-extensions==4.11.0
urllib3==2.2.1
watchdog==4.0.0
wcmatch==8.5.1
webencodings==0.5.1
yamllint==1.35.1

# The following packages are considered to be unsafe in a requirements file:
# resolvelib
# ruamel-yaml-clib
# wcmatch
1 change: 1 addition & 0 deletions .config/dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Chamoulaud
DISTRO
DOTGLOB
ENVVAR
EPEL
EPIPE # linux
Fimport
Jython
Expand Down
5 changes: 3 additions & 2 deletions .config/requirements.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Special order section for helping pip:
will-not-work-on-windows-try-from-wsl-instead; platform_system=='Windows'
ansible-core>=2.12.0 # GPLv3
ansible-core>=2.13.0 # GPLv3
ansible-compat>=4.1.11 # GPLv3
# alphabetically sorted:
black>=24.3.0 # MIT (security)
Expand All @@ -13,4 +13,5 @@ rich>=12.0.0 # MIT
ruamel.yaml>=0.18.5 # MIT
subprocess-tee>=0.4.1 # MIT, used by ansible-compat
yamllint >= 1.30.0 # GPLv3
wcmatch>=8.1.2 # MIT
wcmatch>=8.1.2; python_version < '3.12' # MIT
wcmatch>=8.5.0; python_version >= '3.12' # MIT
19 changes: 19 additions & 0 deletions .github/lower-constraints.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# This file is kept in a different directory than .config in order to not be
# automatically updated by dependabot. This should be kept in sync with
# minimal requirements configured inside .config/requirements.in
ansible-core==2.13.0
ansible-compat==4.1.11 # GPLv3
black==24.3.0 # MIT (security)
filelock==3.3.0 # The Unlicense
jsonschema==4.10.0 # MIT, version needed for improved errors
packaging==21.3
pathspec==0.10.3
pyyaml==5.4.1
rich==12.0.0
ruamel.yaml==0.18.5 # MIT
subprocess-tee==0.4.1 # MIT, used by ansible-compat
# https://packages.ubuntu.com/noble/python3-wcmatch
# https://packages.fedoraproject.org/pkgs/python-wcmatch/python3-wcmatch/
wcmatch==8.1.2; python_version < '3.12' # EPEL 8
wcmatch==8.5.0; python_version >= '3.12'
yamllint == 1.30.0
2 changes: 2 additions & 0 deletions .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ jobs:
eco
pre
py310-devel
py310-lower
py312-lower
platforms: linux,macos
test-action:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pip-log.txt
.python-version

# Coverage artifacts
.coverage
.coverage*
coverage*.xml
pip-wheel-metadata
.test-results/
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ repos:
name: lock
alias: lock
always_run: true
entry: pip-compile --upgrade -q --no-annotate --output-file=.config/requirements-lock.txt pyproject.toml --strip-extras --unsafe-package ruamel-yaml-clib --unsafe-package resolvelib
entry: pip-compile --upgrade --no-annotate --output-file=.config/requirements-lock.txt pyproject.toml --strip-extras --unsafe-package ruamel-yaml-clib --unsafe-package resolvelib
files: ^.config\/.*requirements.*$
language: python
language_version: "3.10" # minimal we support officially
Expand All @@ -217,15 +217,15 @@ repos:
name: deps
alias: deps
always_run: true
entry: pip-compile -q --no-annotate --output-file=.config/constraints.txt pyproject.toml --all-extras --strip-extras --unsafe-package ruamel-yaml-clib --unsafe-package resolvelib
entry: pip-compile --no-annotate --output-file=.config/constraints.txt pyproject.toml --all-extras --strip-extras --unsafe-package wcmatch --unsafe-package ruamel-yaml-clib --unsafe-package resolvelib
files: ^.config\/.*requirements.*$
language: python
language_version: "3.10" # minimal we support officially
pass_filenames: false
additional_dependencies:
- pip>=22.3.1
- id: pip-compile
entry: pip-compile -q --no-annotate --output-file=.config/constraints.txt pyproject.toml --all-extras --strip-extras --unsafe-package ruamel-yaml-clib --unsafe-package resolvelib --upgrade
entry: pip-compile -v --no-annotate --output-file=.config/constraints.txt pyproject.toml --all-extras --strip-extras --unsafe-package wcmatch --unsafe-package ruamel-yaml-clib --unsafe-package resolvelib --upgrade
language: python
always_run: true
pass_filenames: false
Expand Down
4 changes: 2 additions & 2 deletions src/ansiblelint/schemas/__store__.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"url": "https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/molecule.json"
},
"playbook": {
"etag": "642a03707aadf49b54216f5882d6e91509fccaad7fc105fb83e24f15151bfafa",
"etag": "152dbc4407b1538dc940c58159135ea608ce18c9de7832d4351782ae644a5970",
"url": "https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/playbook.json"
},
"requirements": {
Expand All @@ -52,7 +52,7 @@
"url": "https://raw.githubusercontent.com/ansible/ansible-rulebook/main/ansible_rulebook/schema/ruleset_schema.json"
},
"tasks": {
"etag": "495ec0c6cb49d60feed7e2bc7c0ef0135bab473a28c3c8d4a7be4f210e8c53fc",
"etag": "9f3b54cf5cc432d57c9691fb3108a7f37996ab0875e2abb66eda0aa62437dcdc",
"url": "https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/tasks.json"
},
"vars": {
Expand Down
16 changes: 13 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ envlist =
schemas
py
py-devel
lower
pre
eco
isolated_build = true
Expand All @@ -29,11 +30,13 @@ extras =
test
commands_pre =
sh -c "rm -f .tox/.coverage.* 2>/dev/null || true"
bash ./tools/install-reqs.sh
commands =
ansible --version
# safety measure to assure we do not accidentally run tests with broken dependencies
{envpython} -m pip check
{envpython} -m pip freeze
bash ./tools/install-reqs.sh
ansible --version
commands =
{envpython} -m pip freeze
coverage run -m pytest {posargs:\
-n auto \
-ra \
Expand Down Expand Up @@ -105,6 +108,11 @@ setenv =
# avoid messing pre-commit with out own constraints
PIP_CONSTRAINT=

[testenv:lower]
description = Install using lower-constraints.txt file for testing oldest versions.
setenv =
PIP_CONSTRAINT = {toxinidir}/.github/lower-constraints.txt

[testenv:hook]
description = Validate pre-commit hook definition
deps = pre-commit
Expand Down Expand Up @@ -146,6 +154,8 @@ setenv =
TERM = dump
skip_install = false
usedevelop = true
commands_pre =
ansible-lint --version
commands =
mkdocs {posargs:build --strict --site-dir=_readthedocs/html/}

Expand Down
Loading