Skip to content

Commit 2ea33b2

Browse files
committed
Test more on GitHub Actions
The only environments left on AppVeyor are now 3.5 and 3.6, which aren't supported on GitHub Actions. The remaining Python versions are now also tested on Windows using GitHub Actions. Additionally, a new group of dependencies called "oldest" is now tested as well to ensure compatibility with the oldest pinned versions in requirements.txt and setup.py.
1 parent 01b7dea commit 2ea33b2

7 files changed

+92
-43
lines changed

.appveyor.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,10 @@ environment:
33
global:
44
PATH: "C:\\Python27\\Scripts\\;%PATH%"
55
matrix:
6-
- TOXENV: py27-base
7-
- TOXENV: py27-optional
86
- TOXENV: py35-base
97
- TOXENV: py35-optional
108
- TOXENV: py36-base
119
- TOXENV: py36-optional
12-
- TOXENV: py37-base
13-
- TOXENV: py37-optional
14-
- TOXENV: py38-base
15-
- TOXENV: py38-optional
16-
- TOXENV: py39-base
17-
- TOXENV: py39-optional
18-
- TOXENV: py310-base
19-
- TOXENV: py310-optional
2010

2111
install:
2212
- git submodule update --init --recursive

.github/workflows/python-tox.yml

Lines changed: 52 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,68 @@ jobs:
44
# Prevent duplicate builds for 'internal' pull requests on existing commits
55
# Credit: https://github.community/t/duplicate-checks-on-push-and-pull-request-simultaneous-event/18012
66
if: github.event.push || github.event.pull_request.head.repo.full_name != github.repository
7-
runs-on: ubuntu-latest
87
strategy:
98
fail-fast: false
109
matrix:
11-
python: ["2.7", "3.7", "3.8", "3.9", "3.10", "3.11", "pypy-2.7", "pypy-3.8"]
10+
python: ["2.7", "3.7", "3.8", "3.9", "3.10", "3.11"]
11+
os: [ubuntu-latest, windows-latest]
12+
deps: [base, optional]
13+
include:
14+
- python: "pypy-2.7"
15+
os: ubuntu-latest
16+
deps: base
17+
- python: "pypy-3.8"
18+
os: ubuntu-latest
19+
deps: base
20+
- python: "2.7"
21+
os: ubuntu-latest
22+
deps: oldest
23+
- python: "3.7"
24+
os: ubuntu-latest
25+
deps: oldest
26+
runs-on: ${{ matrix.os }}
1227
steps:
1328
- uses: actions/checkout@v3
1429
with:
1530
submodules: true
16-
- uses: actions/setup-python@v4
31+
- if: ${{ matrix.deps == 'base' }}
32+
uses: actions/setup-python@v4
1733
with:
1834
python-version: ${{ matrix.python }}
1935
cache: pip
20-
cache-dependency-path: "requirements*.txt"
36+
cache-dependency-path: |
37+
requirements.txt
38+
requirements-test.txt
39+
- if: ${{ matrix.deps == 'optional' }}
40+
uses: actions/setup-python@v4
41+
with:
42+
python-version: ${{ matrix.python }}
43+
cache: pip
44+
cache-dependency-path: |
45+
requirements.txt
46+
requirements-optional.txt
47+
requirements-test.txt
48+
- if: ${{ matrix.deps == 'oldest' }}
49+
uses: actions/setup-python@v4
50+
with:
51+
python-version: ${{ matrix.python }}
52+
cache: pip
53+
cache-dependency-path: |
54+
requirements-oldest.txt
55+
- name: Determine Python version for Tox
56+
run: |
57+
V=${{ matrix.python }}
58+
if [[ "$V" = pypy-2* ]]; then
59+
V=pypy
60+
elif [[ "$V" = pypy-3* ]]; then
61+
V=pypy3
62+
elif [[ "$V" = ~* ]]; then
63+
V=py$(NORM_V=${V:1:4};echo ${NORM_V//./})
64+
else
65+
V=py${V//./}
66+
fi
67+
echo TOX_PYTHON=$V >>$GITHUB_ENV
2168
- run: pip install tox
22-
- run: tox -e py
69+
run: tox -e ${{ env.TOX_PYTHON }}-${{ matrix.deps }}
2370
- if: ${{ always() }}
2471
run: python debug-info.py

requirements-install.sh

Lines changed: 0 additions & 15 deletions
This file was deleted.

requirements-oldest.txt

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# This allows us to install the actually oldest supported dependencies and test whether that works.
2+
3+
# requirements.txt
4+
six==1.9
5+
webencodings==0.5.1
6+
7+
# requirements-optional.txt
8+
genshi==0.7.1 ; python_version < '3.8'
9+
genshi==0.7.6 ; python_version >= '3.8'
10+
chardet==2.2.1
11+
lxml==3.4.0 ; python_version < '3.7'
12+
# minimums for 3.x are actually different:
13+
# - 3.7 is actually 4.1.1
14+
# - 3.8 is actually 4.3.5
15+
# - 3.9-3.10 is actually 4.5.2
16+
# - 3.11 is actually 4.9.0
17+
lxml==4.9.0 ; python_version >= '3.7'
18+
19+
# requirements-test.txt
20+
tox==3.15.1
21+
flake8==3.8.1
22+
pytest==4.6.10 ; python_version < '3'
23+
pytest==5.4.2 ; python_version >= '3'
24+
coverage==5.1
25+
pytest-expect==1.1.0
26+
mock==3.0.5 ; python_version < '3.6'
27+
mock==4.0.2 ; python_version >= '3.6'

requirements-optional.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
# We support a Genshi treewalker that can be used to serialize Genshi
44
# streams.
5-
genshi
5+
genshi>=0.7.1
66

77
# chardet can be used as a fallback in case we are unable to determine
88
# the encoding of a document.
9-
chardet>=2.2
9+
chardet>=2.2.1
1010

1111
# lxml is supported with its own treebuilder ("lxml") and otherwise
1212
# uses the standard ElementTree support
13-
lxml ; platform_python_implementation == 'CPython'
13+
lxml>=3.4.0 ; platform_python_implementation == 'CPython'

setup.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,23 +108,23 @@ def default_environment():
108108
packages=find_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests"]),
109109
install_requires=[
110110
'six>=1.9',
111-
'webencodings',
111+
'webencodings>=0.5.1',
112112
],
113113
python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*",
114114
extras_require={
115115
# A conditional extra will only install these items when the extra is
116116
# requested and the condition matches.
117-
"lxml:platform_python_implementation == 'CPython'": ["lxml"],
117+
"lxml:platform_python_implementation == 'CPython'": ["lxml>=3.4.0"],
118118

119119
# Standard extras, will be installed when the extra is requested.
120-
"genshi": ["genshi"],
121-
"chardet": ["chardet>=2.2"],
120+
"genshi": ["genshi>=0.7.1"],
121+
"chardet": ["chardet>=2.2.1"],
122122

123123
# The all extra combines a standard extra which will be used anytime
124124
# the all extra is requested, and it extends it with a conditional
125125
# extra that will be installed whenever the condition matches and the
126126
# all extra is requested.
127-
"all": ["genshi", "chardet>=2.2"],
128-
"all:platform_python_implementation == 'CPython'": ["lxml"],
127+
"all": ["genshi>=0.7.1", "chardet>=2.2.1"],
128+
"all:platform_python_implementation == 'CPython'": ["lxml>=3.4.0"],
129129
},
130130
)

tox.ini

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
[tox]
2-
envlist = py{27,35,36,37,38,39,310,311,py,py3}-{base,six19,optional}
2+
envlist = py{27,35,36,37,38,39,310,311,py,py3}-{base,optional,oldest}
33

44
[testenv]
55
deps =
6-
optional: -r{toxinidir}/requirements-optional.txt
7-
-r{toxinidir}/requirements-test.txt
6+
base: -r{toxinidir}/requirements-test.txt
7+
optional: -r{toxinidir}/requirements-test.txt -r{toxinidir}/requirements-optional.txt
8+
oldest: -r{toxinidir}/requirements-oldest.txt
89
doc: Sphinx
910

1011
passenv =
1112
PYTEST_COMMAND # this is maintained so one can, e.g., PYTEST_COMMAND="coverage run -m pytest"
1213
COVERAGE_RUN_OPTIONS
1314
commands =
14-
six19: pip install six==1.9
1515
{env:PYTEST_COMMAND:{envbindir}/pytest} {posargs}
1616
flake8 {toxinidir}
1717

0 commit comments

Comments
 (0)