Skip to content

Commit

Permalink
Use python 3.10 as primary version target (#3886)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea authored Nov 7, 2023
1 parent 4a703a4 commit 634c639
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 28 deletions.
7 changes: 3 additions & 4 deletions .config/requirements-lock.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#
# This file is autogenerated by pip-compile with Python 3.9
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
# pip-compile --no-annotate --output-file=.config/requirements-lock.txt --strip-extras --unsafe-package=resolvelib --unsafe-package=ruamel-yaml-clib pyproject.toml
#
ansible-compat==4.1.10
ansible-core==2.15.5
ansible-core==2.16.0
attrs==23.1.0
black==23.10.1
bracex==2.4
Expand All @@ -16,7 +16,6 @@ click==8.1.7
cryptography==41.0.5
filelock==3.13.1
idna==3.4
importlib-resources==5.0.7
jinja2==3.1.2
jsonschema==4.19.2
jsonschema-specifications==2023.7.1
Expand All @@ -33,7 +32,7 @@ pyyaml==6.0.1
referencing==0.30.2
requests==2.31.0
rich==13.6.0
rpds-py==0.10.6
rpds-py==0.12.0
ruamel-yaml==0.18.5
subprocess-tee==0.4.1
tomli==2.0.1
Expand Down
7 changes: 3 additions & 4 deletions .config/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#
# This file is autogenerated by pip-compile with Python 3.9
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
# 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
#
ansible-compat==4.1.10
ansible-core==2.15.5
ansible-core==2.16.0
astroid==3.0.1
attrs==23.1.0
babel==2.12.1
Expand Down Expand Up @@ -35,7 +35,6 @@ griffe==0.36.4
htmlmin2==0.1.13
idna==3.4
importlib-metadata==6.8.0
importlib-resources==5.0.7
iniconfig==2.0.0
isort==5.12.0
jinja2==3.1.2
Expand Down Expand Up @@ -90,7 +89,7 @@ referencing==0.30.2
regex==2023.8.8
requests==2.31.0
rich==13.6.0
rpds-py==0.10.6
rpds-py==0.12.0
ruamel-yaml==0.18.5
six==1.16.0
soupsieve==2.5
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ jobs:
TOXENV: pkg

steps:
- name: Switch to using Python 3.9 by default
- name: Switch to using Python 3.10 by default
uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: "3.10"

- name: Install tox
run: python3 -m pip install --user "tox>=4.0.0"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,12 @@ jobs:
~/.ansible/roles
key: ${{ matrix.name || matrix.passed_name }}-${{ hashFiles('tools/test-eco.sh', 'requirements.yml', 'examples/playbooks/collections/requirements.yml') }}

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

- uses: actions/setup-node@v4
with:
Expand Down
7 changes: 4 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ repos:
- rich>=13.2.0
- ruamel-yaml-clib>=0.2.7
- ruamel-yaml>=0.18.2
- setuptools # needed for pkg_resources import
- typing_extensions
- wcmatch
- yamllint
Expand All @@ -202,7 +203,7 @@ repos:
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
files: ^.config\/requirements.*$
language: python
language_version: "3.9" # minimal we support officially
language_version: "3.10" # minimal we support officially
pass_filenames: false
stages: [manual]
additional_dependencies:
Expand All @@ -214,7 +215,7 @@ repos:
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
files: ^.config\/requirements.*$
language: python
language_version: "3.9" # minimal we support officially
language_version: "3.10" # minimal we support officially
pass_filenames: false
additional_dependencies:
- pip>=22.3.1
Expand All @@ -226,7 +227,7 @@ repos:
files: ^.config\/requirements.*$
alias: up
stages: [manual]
language_version: "3.9" # minimal we support officially
language_version: "3.10" # minimal we support officially
additional_dependencies:
- pip>=22.3.1
- # keep at bottom as these are slower
Expand Down
13 changes: 12 additions & 1 deletion docs/installing.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ automation content.
[discussion](https://github.com/ansible/ansible-lint/discussions/2820#discussioncomment-4400380).

Pull requests to improve installation instructions are welcome. Any new issues
related to installation will be closed and locked.
related to the installation will be closed and locked.

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

!!! note

If you want to install the exact versions of all dependencies that were used
to test a specific version of ansible-lint, you can add `lock` extra. This
will only work with Python 3.10 or newer. Do this only inside a
virtual environment.

```bash
pip3 install "ansible-lint[lock]"
```

## Installing on Fedora and RHEL

You can install Ansible-lint on Fedora, or Red Hat Enterprise Linux (RHEL) with
Expand Down
14 changes: 7 additions & 7 deletions test/schemas/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test/schemas/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@types/chai": "^4.3.9",
"@types/js-yaml": "^4.0.8",
"@types/minimatch": "^5.1.2",
"@types/mocha": "^10.0.3",
"@types/mocha": "^10.0.4",
"@types/node": "^20.8.10",
"chai": "^4.3.10",
"minimatch": "^9.0.3",
Expand Down
8 changes: 4 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ setenv =
COVERAGE_FILE = {env:COVERAGE_FILE:{toxworkdir}/.coverage.{envname}}
COVERAGE_PROCESS_START={toxinidir}/pyproject.toml
PIP_CONSTRAINT = {toxinidir}/.config/requirements.txt
devel,pkg,pre: PIP_CONSTRAINT = /dev/null
devel,pkg,pre,py39: PIP_CONSTRAINT = /dev/null
PIP_DISABLE_PIP_VERSION_CHECK = 1
PRE_COMMIT_COLOR = always
FORCE_COLOR = 1
Expand All @@ -87,7 +87,7 @@ package = editable
description = Run all linters
# pip compile includes python version in output constraints, so we want to
# be sure that version does not change randomly.
basepython = python3.9
basepython = python3.10
deps =
pre-commit>=2.6.0
setuptools>=51.1.1
Expand Down Expand Up @@ -117,7 +117,7 @@ description = Bump all test dependencies
# we reuse the lint environment
envdir = {toxworkdir}/lint
skip_install = true
basepython = python3.9
basepython = python3.10
deps =
{[testenv:lint]deps}
setenv =
Expand Down Expand Up @@ -205,7 +205,7 @@ commands =
# Validate metadata using twine
python3 -m twine check --strict {toxinidir}/dist/*
# Install the wheel
sh -c 'python3 -m pip install "ansible-lint[lock] @ file://$(echo {toxinidir}/dist/*.whl)"'
sh -c 'python3 -m pip install "ansible-lint @ file://$(echo {toxinidir}/dist/*.whl)"'
# Uninstall it
python3 -m pip uninstall -y ansible-lint

Expand Down

0 comments on commit 634c639

Please sign in to comment.