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 Python 3.11 and PyPy 3.9 to the testing and drop 3.6 #567

Merged
merged 4 commits into from
Feb 28, 2023
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
90 changes: 45 additions & 45 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,25 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["pypy-3.7", "3.9"]
python-version: ["pypy-3.9", "3.11"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it be pypy 3.8 (3.7 was dropped but the lower bound seems to be 3.8 not 3.9) ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are UPPER bounds, not lower bounds.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought it was lower bound (3.7) and upper bound (3.9). Wouldn't we use 3.9 only if it was upper bounds ?

target: [
"src-layout",
"adhoc-layout",
]
include:
# Add new helper variables to existing jobs
- {python-version: "pypy-3.7", tox-python-version: "pypy3"}
- {python-version: "3.9", tox-python-version: "py39"}
- {python-version: "pypy-3.9", tox-python-version: "pypy3"}
- {python-version: "3.11", tox-python-version: "py311"}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.cache/pip
key:
Expand All @@ -34,8 +34,8 @@ jobs:

- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install -U wheel
python -m pip install --upgrade pip
python -m pip install --upgrade wheel
python -m pip install --progress-bar=off tox -rci/requirements.txt

- name: Examples
Expand All @@ -51,33 +51,15 @@ jobs:
matrix:
include:
- name: 'check'
python: '3.9'
toxpython: 'python3.9'
python: '3.11'
toxpython: 'python3.11'
tox_env: 'check'
os: 'ubuntu-latest'
- name: 'docs'
python: '3.9'
toxpython: 'python3.9'
python: '3.11'
toxpython: 'python3.11'
tox_env: 'docs'
os: 'ubuntu-latest'
- name: 'py36-pytest70-xdist250-coverage62 (ubuntu)'
python: '3.6'
toxpython: 'python3.6'
python_arch: 'x64'
tox_env: 'py36-pytest70-xdist250-coverage62'
os: 'ubuntu-latest'
- name: 'py36-pytest70-xdist250-coverage62 (windows)'
python: '3.6'
toxpython: 'python3.6'
python_arch: 'x64'
tox_env: 'py36-pytest70-xdist250-coverage62'
os: 'windows-latest'
- name: 'py36-pytest70-xdist250-coverage62 (macos)'
python: '3.6'
toxpython: 'python3.6'
python_arch: 'x64'
tox_env: 'py36-pytest70-xdist250-coverage62'
os: 'macos-latest'
- name: 'py37-pytest71-xdist250-coverage64 (ubuntu)'
python: '3.7'
toxpython: 'python3.7'
Expand Down Expand Up @@ -150,23 +132,23 @@ jobs:
python_arch: 'x64'
tox_env: 'py310-pytest71-xdist250-coverage64'
os: 'macos-latest'
- name: 'pypy37-pytest71-xdist250-coverage64 (ubuntu)'
python: 'pypy-3.7'
toxpython: 'pypy3.7'
- name: 'py311-pytest72-xdist320-coverage65 (ubuntu)'
python: '3.11'
toxpython: 'python3.11'
python_arch: 'x64'
tox_env: 'pypy37-pytest71-xdist250-coverage64'
tox_env: 'py311-pytest72-xdist320-coverage65'
os: 'ubuntu-latest'
- name: 'pypy37-pytest71-xdist250-coverage64 (windows)'
python: 'pypy-3.7'
toxpython: 'pypy3.7'
- name: 'py311-pytest72-xdist320-coverage65 (windows)'
python: '3.11'
toxpython: 'python3.11'
python_arch: 'x64'
tox_env: 'pypy37-pytest71-xdist250-coverage64'
tox_env: 'py311-pytest72-xdist320-coverage65'
os: 'windows-latest'
- name: 'pypy37-pytest71-xdist250-coverage64 (macos)'
python: 'pypy-3.7'
toxpython: 'pypy3.7'
- name: 'py311-pytest72-xdist320-coverage65 (macos)'
python: '3.11'
toxpython: 'python3.11'
python_arch: 'x64'
tox_env: 'pypy37-pytest71-xdist250-coverage64'
tox_env: 'py311-pytest72-xdist320-coverage65'
os: 'macos-latest'
- name: 'pypy38-pytest71-xdist250-coverage64 (ubuntu)'
python: 'pypy-3.8'
Expand All @@ -186,17 +168,35 @@ jobs:
python_arch: 'x64'
tox_env: 'pypy38-pytest71-xdist250-coverage64'
os: 'macos-latest'
- name: 'pypy39--pytest72-xdist320-coverage65 (ubuntu)'
python: 'pypy-3.9'
toxpython: 'pypy3.9'
python_arch: 'x64'
tox_env: 'pypy39-pytest72-xdist320-coverage65'
os: 'ubuntu-latest'
- name: 'pypy39-pytest72-xdist320-coverage65 (windows)'
python: 'pypy-3.9'
toxpython: 'pypy3.9'
python_arch: 'x64'
tox_env: 'pypy39-pytest72-xdist320-coverage65'
os: 'windows-latest'
- name: 'pypy39-pytest72-xdist320-coverage65 (macos)'
python: 'pypy-3.9'
toxpython: 'pypy3.9'
python_arch: 'x64'
tox_env: 'pypy39-pytest72-xdist320-coverage65'
os: 'macos-latest'
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
architecture: ${{ matrix.python_arch }}
- name: install dependencies
run: |
python -mpip install --progress-bar=off -r ci/requirements.txt
python -m pip install --progress-bar=off -r ci/requirements.txt
virtualenv --version
pip --version
tox --version
Expand Down
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@
# pre-commit autoupdate
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
exclude: '.*\.pth$'
- id: debug-statements
- repo: https://github.com/PyCQA/isort
rev: 5.10.1
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/asottile/pyupgrade
rev: v3.2.2
rev: v3.3.1
hooks:
- id: pyupgrade
args: [--py36-plus]
args: [--py37-plus]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If dropping 3.6, there's also the classifier and python_requires in setup.py. Plus mention in the PR title.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think also need to update few parts related to Python 3.6 if this PR is going to drop 3.6.

https://github.com/pytest-dev/pytest-cov/blob/master/setup.py#L114

Copy link
Contributor Author

@cclauss cclauss Feb 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done below.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's also mention the 3.6 drop in the PR title for visibility/transparency.

- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
rev: 6.0.0
hooks:
- id: flake8
2 changes: 1 addition & 1 deletion ci/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def main():
# This uses sys.executable the same way that the call in
# cookiecutter-pylibrary/hooks/post_gen_project.py
# invokes this bootstrap.py itself.
for line in subprocess.check_output([sys.executable, '-m', 'tox', '--listenvs'], universal_newlines=True).splitlines()
for line in subprocess.check_output([sys.executable, '-m', 'tox', '--listenvs'], text=True).splitlines()
]
tox_environments = [line for line in tox_environments if line.startswith('py')]

Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,11 @@ def run(self):
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Topic :: Software Development :: Testing',
Expand All @@ -133,7 +133,7 @@ def run(self):
'pytest>=4.6',
'coverage[toml]>=5.2.1'
],
python_requires='>=3.6',
python_requires='>=3.7',
extras_require={
'testing': [
'fields',
Expand Down
3 changes: 3 additions & 0 deletions tests/test_pytest_cov.py
Original file line number Diff line number Diff line change
Expand Up @@ -1556,6 +1556,8 @@ def test_foo():
SCRIPT_SIMPLE_RESULT = '4 * 100%'


@pytest.mark.skipif('tuple(int(x) for x in xdist.__version__.split(".")) >= (2, 5, 0)',
reason="--boxed option was removed in version 2.5.0")
@pytest.mark.skipif('sys.platform == "win32"')
def test_dist_boxed(testdir):
script = testdir.makepyfile(SCRIPT_SIMPLE)
Expand Down Expand Up @@ -1916,6 +1918,7 @@ def find_labels(text, pattern):


@pytest.mark.skipif("coverage.version_info < (5, 0)")
@pytest.mark.skipif("coverage.version_info > (6, 4)")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reason for skipping coverage > 6.4?

Copy link
Contributor Author

@cclauss cclauss Feb 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xdist_params
def test_contexts(pytester, testdir, opts):
with open(os.path.join(os.path.dirname(__file__), "contextful.py")) as f:
Expand Down
12 changes: 8 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ passenv =
[tox]
envlist =
check
py{36}-pytest{70}-xdist250-coverage{62}
py{37,38,39,310,py37,py38}-pytest{71}-xdist250-coverage{64}
py{311,py39}-pytest{72}-xdist320-coverage{65}
docs

[testenv]
Expand All @@ -30,6 +30,7 @@ setenv =
pytest62: _DEP_PYTEST=pytest==6.2.5
pytest70: _DEP_PYTEST=pytest==7.0.1
pytest71: _DEP_PYTEST=pytest==7.1.2
pytest72: _DEP_PYTEST=pytest==7.2.0

xdist127: _DEP_PYTESTXDIST=pytest-xdist==1.27.0
xdist129: _DEP_PYTESTXDIST=pytest-xdist==1.29.0
Expand All @@ -41,6 +42,7 @@ setenv =
xdist201: _DEP_PYTESTXDIST=pytest-xdist==2.1.0
xdist202: _DEP_PYTESTXDIST=pytest-xdist==2.2.0
xdist250: _DEP_PYTESTXDIST=pytest-xdist==2.5.0
xdist320: _DEP_PYTESTXDIST=pytest-xdist==3.2.0
xdistdev: _DEP_PYTESTXDIST=git+https://github.com/pytest-dev/pytest-xdist.git#egg=pytest-xdist

coverage45: _DEP_COVERAGE=coverage==4.5.4
Expand All @@ -55,6 +57,7 @@ setenv =
coverage62: _DEP_COVERAGE=coverage==6.2
coverage63: _DEP_COVERAGE=coverage==6.3.3
coverage64: _DEP_COVERAGE=coverage==6.4.2
coverage65: _DEP_COVERAGE=coverage==6.5.0
# For testing against a coverage.py working tree.
coveragedev: _DEP_COVERAGE=-e{env:COVERAGE_HOME}
passenv =
Expand Down Expand Up @@ -87,12 +90,13 @@ commands =

[testenv:check]
deps =
docutils
check-manifest
colorama # TODO Remove when isort > v6.0.0b2 is released.
docutils
flake8
readme-renderer
pygments
isort
pygments
readme-renderer
skip_install = true
usedevelop = false
commands =
Expand Down