Skip to content

Commit a812abf

Browse files
committed
Use python 3.10 as primary version target
- locked dependencies will use py310 instead of py39 - use py310 in places where we previously used py39 - does not remove support for py39 yet - document lock extra - update test dependencies
1 parent 4a703a4 commit a812abf

File tree

9 files changed

+38
-28
lines changed

9 files changed

+38
-28
lines changed

.config/requirements-lock.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#
2-
# This file is autogenerated by pip-compile with Python 3.9
2+
# This file is autogenerated by pip-compile with Python 3.10
33
# by the following command:
44
#
55
# pip-compile --no-annotate --output-file=.config/requirements-lock.txt --strip-extras --unsafe-package=resolvelib --unsafe-package=ruamel-yaml-clib pyproject.toml
66
#
77
ansible-compat==4.1.10
8-
ansible-core==2.15.5
8+
ansible-core==2.16.0
99
attrs==23.1.0
1010
black==23.10.1
1111
bracex==2.4
@@ -16,7 +16,6 @@ click==8.1.7
1616
cryptography==41.0.5
1717
filelock==3.13.1
1818
idna==3.4
19-
importlib-resources==5.0.7
2019
jinja2==3.1.2
2120
jsonschema==4.19.2
2221
jsonschema-specifications==2023.7.1
@@ -33,7 +32,7 @@ pyyaml==6.0.1
3332
referencing==0.30.2
3433
requests==2.31.0
3534
rich==13.6.0
36-
rpds-py==0.10.6
35+
rpds-py==0.12.0
3736
ruamel-yaml==0.18.5
3837
subprocess-tee==0.4.1
3938
tomli==2.0.1

.config/requirements.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#
2-
# This file is autogenerated by pip-compile with Python 3.9
2+
# This file is autogenerated by pip-compile with Python 3.10
33
# by the following command:
44
#
55
# pip-compile --extra=docs --extra=test --no-annotate --output-file=.config/requirements.txt --strip-extras --unsafe-package=resolvelib --unsafe-package=ruamel-yaml-clib pyproject.toml
66
#
77
ansible-compat==4.1.10
8-
ansible-core==2.15.5
8+
ansible-core==2.16.0
99
astroid==3.0.1
1010
attrs==23.1.0
1111
babel==2.12.1
@@ -35,7 +35,6 @@ griffe==0.36.4
3535
htmlmin2==0.1.13
3636
idna==3.4
3737
importlib-metadata==6.8.0
38-
importlib-resources==5.0.7
3938
iniconfig==2.0.0
4039
isort==5.12.0
4140
jinja2==3.1.2
@@ -90,7 +89,7 @@ referencing==0.30.2
9089
regex==2023.8.8
9190
requests==2.31.0
9291
rich==13.6.0
93-
rpds-py==0.10.6
92+
rpds-py==0.12.0
9493
ruamel-yaml==0.18.5
9594
six==1.16.0
9695
soupsieve==2.5

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ jobs:
3232
TOXENV: pkg
3333

3434
steps:
35-
- name: Switch to using Python 3.9 by default
35+
- name: Switch to using Python 3.10 by default
3636
uses: actions/setup-python@v4
3737
with:
38-
python-version: 3.9
38+
python-version: "3.10"
3939

4040
- name: Install tox
4141
run: python3 -m pip install --user "tox>=4.0.0"

.github/workflows/tox.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,12 @@ jobs:
9696
~/.ansible/roles
9797
key: ${{ matrix.name || matrix.passed_name }}-${{ hashFiles('tools/test-eco.sh', 'requirements.yml', 'examples/playbooks/collections/requirements.yml') }}
9898

99-
- name: Set up Python ${{ matrix.python_version || '3.9' }}
99+
- name: Set up Python ${{ matrix.python_version || '3.10' }}
100100
if: "!contains(matrix.shell, 'wsl')"
101101
uses: actions/setup-python@v4
102102
with:
103103
cache: pip
104-
python-version: ${{ matrix.python_version || '3.9' }}
104+
python-version: ${{ matrix.python_version || '3.10' }}
105105

106106
- uses: actions/setup-node@v4
107107
with:

.pre-commit-config.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ repos:
189189
- rich>=13.2.0
190190
- ruamel-yaml-clib>=0.2.7
191191
- ruamel-yaml>=0.18.2
192+
- setuptools # needed for pkg_resources import
192193
- typing_extensions
193194
- wcmatch
194195
- yamllint
@@ -202,7 +203,7 @@ repos:
202203
entry: pip-compile --upgrade --resolver=backtracking -q --no-annotate --output-file=.config/requirements-lock.txt pyproject.toml --strip-extras --unsafe-package ruamel-yaml-clib --unsafe-package resolvelib
203204
files: ^.config\/requirements.*$
204205
language: python
205-
language_version: "3.9" # minimal we support officially
206+
language_version: "3.10" # minimal we support officially
206207
pass_filenames: false
207208
stages: [manual]
208209
additional_dependencies:
@@ -214,7 +215,7 @@ repos:
214215
entry: pip-compile --resolver=backtracking -q --no-annotate --output-file=.config/requirements.txt pyproject.toml --extra docs --extra test --strip-extras --unsafe-package ruamel-yaml-clib --unsafe-package resolvelib
215216
files: ^.config\/requirements.*$
216217
language: python
217-
language_version: "3.9" # minimal we support officially
218+
language_version: "3.10" # minimal we support officially
218219
pass_filenames: false
219220
additional_dependencies:
220221
- pip>=22.3.1
@@ -226,7 +227,7 @@ repos:
226227
files: ^.config\/requirements.*$
227228
alias: up
228229
stages: [manual]
229-
language_version: "3.9" # minimal we support officially
230+
language_version: "3.10" # minimal we support officially
230231
additional_dependencies:
231232
- pip>=22.3.1
232233
- # keep at bottom as these are slower

docs/installing.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ automation content.
2727
[discussion](https://github.com/ansible/ansible-lint/discussions/2820#discussioncomment-4400380).
2828

2929
Pull requests to improve installation instructions are welcome. Any new issues
30-
related to installation will be closed and locked.
30+
related to the installation will be closed and locked.
3131

3232
For a container image, we recommend using
3333
[creator-ee](https://github.com/ansible/creator-ee/), which includes
@@ -50,6 +50,17 @@ current Python environment as an alternative to creating a virtual environment.
5050
pip3 install ansible-lint
5151
```
5252

53+
!!! note
54+
55+
If you want to install the exact versions of all dependencies that were used
56+
to test a specific version of ansible-lint, you can add `lock` extra. This
57+
will only work with Python 3.10 or newer. Do this only inside a
58+
virtual environment.
59+
60+
```bash
61+
pip3 install "ansible-lint[lock]"
62+
```
63+
5364
## Installing on Fedora and RHEL
5465

5566
You can install Ansible-lint on Fedora, or Red Hat Enterprise Linux (RHEL) with

test/schemas/package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/schemas/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"@types/chai": "^4.3.9",
1616
"@types/js-yaml": "^4.0.8",
1717
"@types/minimatch": "^5.1.2",
18-
"@types/mocha": "^10.0.3",
18+
"@types/mocha": "^10.0.4",
1919
"@types/node": "^20.8.10",
2020
"chai": "^4.3.10",
2121
"minimatch": "^9.0.3",

tox.ini

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ setenv =
6666
COVERAGE_FILE = {env:COVERAGE_FILE:{toxworkdir}/.coverage.{envname}}
6767
COVERAGE_PROCESS_START={toxinidir}/pyproject.toml
6868
PIP_CONSTRAINT = {toxinidir}/.config/requirements.txt
69-
devel,pkg,pre: PIP_CONSTRAINT = /dev/null
69+
devel,pkg,pre,py39: PIP_CONSTRAINT = /dev/null
7070
PIP_DISABLE_PIP_VERSION_CHECK = 1
7171
PRE_COMMIT_COLOR = always
7272
FORCE_COLOR = 1
@@ -87,7 +87,7 @@ package = editable
8787
description = Run all linters
8888
# pip compile includes python version in output constraints, so we want to
8989
# be sure that version does not change randomly.
90-
basepython = python3.9
90+
basepython = python3.10
9191
deps =
9292
pre-commit>=2.6.0
9393
setuptools>=51.1.1
@@ -117,7 +117,7 @@ description = Bump all test dependencies
117117
# we reuse the lint environment
118118
envdir = {toxworkdir}/lint
119119
skip_install = true
120-
basepython = python3.9
120+
basepython = python3.10
121121
deps =
122122
{[testenv:lint]deps}
123123
setenv =
@@ -205,7 +205,7 @@ commands =
205205
# Validate metadata using twine
206206
python3 -m twine check --strict {toxinidir}/dist/*
207207
# Install the wheel
208-
sh -c 'python3 -m pip install "ansible-lint[lock] @ file://$(echo {toxinidir}/dist/*.whl)"'
208+
sh -c 'python3 -m pip install "ansible-lint @ file://$(echo {toxinidir}/dist/*.whl)"'
209209
# Uninstall it
210210
python3 -m pip uninstall -y ansible-lint
211211

0 commit comments

Comments
 (0)