Skip to content

Commit 2b91f95

Browse files
committed
ci: tox-lsr 3.4.0 - fix py27 tests; move other checks to py310
The latest version of virtualenv does not support creating python 2.7 virtualenvs. Change our CI tests to restrict the version of virtualenv<20.22.0 and tox<4.15 for py27 environments Move pylint, flake8, and black checks to the py310 environment which is currently supported by ansible-core 2.17 and its related checkers such as ansible-lint and ansible-test pylint now uses ansible-core 2.17 and restricts the version of pylint to 3.1.0 which is the version used by ansible-test 2.17 Remove `extends: default` for .yamllint.yml. The latest version of ansible-lint will automatically incorporate local yamllint settings unless there is an `extends:`. The above changes require some fixes to the role code. For more information, see linux-system-roles/tox-lsr#168 and linux-system-roles/tox-lsr#170 Signed-off-by: Rich Megginson <[email protected]>
1 parent 7862d28 commit 2b91f95

6 files changed

+15
-10
lines changed

.github/workflows/ansible-lint.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
- name: Install tox, tox-lsr
3333
run: |
3434
set -euxo pipefail
35-
pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.3.0"
35+
pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.4.0"
3636
3737
- name: Convert role to collection format
3838
run: |

.github/workflows/ansible-managed-var-comment.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- name: Install tox, tox-lsr
3131
run: |
3232
set -euxo pipefail
33-
pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.3.0"
33+
pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.4.0"
3434
3535
- name: Run ansible-plugin-scan
3636
run: |

.github/workflows/ansible-plugin-scan.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- name: Install tox, tox-lsr
3131
run: |
3232
set -euxo pipefail
33-
pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.3.0"
33+
pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.4.0"
3434
3535
- name: Run ansible-plugin-scan
3636
run: |

.github/workflows/ansible-test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
- name: Install tox, tox-lsr
3434
run: |
3535
set -euxo pipefail
36-
pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.3.0"
36+
pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.4.0"
3737
3838
- name: Convert role to collection format
3939
run: |

.github/workflows/python-unit-test.yml

+11-5
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,16 @@ jobs:
5858
run: |
5959
set -euxo pipefail
6060
python -m pip install --upgrade pip
61-
pip install "git+https://github.com/linux-system-roles/[email protected]"
61+
if [ "${{ matrix.pyver_os.ver }}" = 2.7 ]; then
62+
# newer virtualenv cannot create python2 venvs
63+
# newer tox requires newer virtualenv
64+
tox='tox<4.15'
65+
virtualenv='virtualenv<20.22.0'
66+
else
67+
tox=tox
68+
virtualenv=virtualenv
69+
fi
70+
pip install "$tox" "$virtualenv" "git+https://github.com/linux-system-roles/[email protected]"
6271
# If you have additional OS dependency packages e.g. libcairo2-dev
6372
# then put them in .github/config/ubuntu-requirements.txt, one
6473
# package per line.
@@ -73,11 +82,8 @@ jobs:
7382
toxenvs="py${toxpyver}"
7483
# NOTE: The use of flake8, pylint, black with specific
7584
# python envs is arbitrary and must be changed in tox-lsr
76-
# We really should either do those checks using the latest
77-
# version of python, or in every version of python
7885
case "$toxpyver" in
79-
27) toxenvs="${toxenvs},coveralls,flake8,pylint" ;;
80-
36) toxenvs="${toxenvs},coveralls,black" ;;
86+
310) toxenvs="${toxenvs},coveralls,flake8,pylint,black" ;;
8187
*) toxenvs="${toxenvs},coveralls" ;;
8288
esac
8389
TOXENV="$toxenvs" lsr_ci_runtox

.yamllint.yml

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# SPDX-License-Identifier: MIT
22
---
3-
extends: default
43
ignore: |
54
/.tox/

0 commit comments

Comments
 (0)