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

Support Python 3.11, drop older Pythons entirely #59

Closed
wants to merge 23 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
8c70e22
Add support for Python 3.11
hugovk Nov 6, 2022
198870f
Bump checkout to v3 in CodeQL Analysis workflow
colindean Dec 16, 2022
cc5c60f
Drops Actions builds for Python 2.7, 3.5, 3.6; condense 3.7+
colindean Dec 16, 2022
8cc3832
Upgrades some actions versions in Actions python builds
colindean Dec 16, 2022
73a36f0
Drops Python 2.7, 3.5, 3.6 builds from Travis; add 3.12
colindean Dec 16, 2022
208c2fd
Drops Python older than 3.7 from the rest of things
colindean Dec 16, 2022
0d1d0ca
Split and fix tox config for more better coverage
colindean Dec 16, 2022
1827126
Adds importlib-metadata to dev deps
colindean Dec 16, 2022
fe8014d
Use newer Travis environment, Focal (Ubuntu 20.04)
colindean Dec 16, 2022
0b84709
Try installing importlib_metadata for tox run
colindean Dec 16, 2022
d5926ba
Limit tox to <4 on Travis because of outdatedness
colindean Dec 16, 2022
9aad5c9
Adds Python 3.12 config to tox
colindean Dec 16, 2022
bc42a86
Use specifically pypy3.9 v7.3.9
colindean Dec 16, 2022
97b7e06
Drop the .9 from pypy3 in tox.ini
colindean Dec 16, 2022
e930748
Drops old Pythons and adds newer ones for Appveyor build
colindean Dec 16, 2022
74a386a
Exclude pypy3 on ppc64le on Travis builds
colindean Dec 16, 2022
69472db
Try explicitly setting AppVeyor image to VS2022
colindean Dec 16, 2022
29d806e
Adds srpm_build_deps to Packit config
colindean Dec 16, 2022
b452239
Drops limitation on tox < 4 since bug was fixed
colindean Jan 16, 2023
f01db11
Adds Pythons dropped notice to changelog
colindean Jan 16, 2023
4658fe7
Fixes comment on which version is development branch
colindean Jan 16, 2023
450dd3c
Drops seemingly unused importlib-metadata dev dep
colindean Jan 16, 2023
25f8de7
Merge branch 'master' into py311-redux
tantale May 27, 2023
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
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
32 changes: 5 additions & 27 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,41 +10,18 @@ on:
branches: [ master ]

jobs:
pytest-py27-p35:
runs-on: ${{ matrix.platform }}

pytest:
strategy:
matrix:
platform: [ ubuntu-latest, macos-latest, windows-latest ]
python-version: [ 2.7, 3.5 ]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade 'pip < 21'
python -m pip install 'PyTest < 5'
python -m pip install -e .
- name: Test with pytest
run: |
pytest tests/
python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11" ]

pytest-py36-py310:
runs-on: ${{ matrix.platform }}

strategy:
matrix:
platform: [ ubuntu-latest, macos-latest, windows-latest ]
python-version: [ "3.6", "3.7", "3.8", "3.9", "3.10" ]

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: Install dependencies
Expand All @@ -55,3 +32,4 @@ jobs:
- name: Test with pytest
run: |
pytest tests/

5 changes: 5 additions & 0 deletions .packit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,8 @@ jobs:
metadata:
targets:
- fedora-all

srpm_build_deps:
- python3-pip
- python3-setuptools_scm

25 changes: 9 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,24 @@
dist: focal
arch:
- amd64
- ppc64le
language: python
python:
- "2.7"
- "3.5"
- "3.6"
- "3.7"
- "3.8"
- "3.9"
- "3.10-dev" # 3.10 development branch
- "pypy"
- "pypy3"
- "3.10"
- "3.11"
- "3.12-dev" # development branch
- "pypy3.9-7.3.9"
jobs:
exclude:
- arch: ppc64le
python: "2.7"
- arch: ppc64le
python: "pypy"
- arch: ppc64le
python: "pypy3"
- arch: amd64
python: "pypy"

python: "pypy3.9-7.3.9"

allow_failures:
- python: "3.10-dev"
- python: "3.12-dev"

install:
- pip install coveralls tox-travis
script:
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ Fix

- Fix #60: return a correctly dedented docstring when long docstring are using the D212 or D213 format.

GitHub Workflows
----------------

- Add support for Python 3.11.

This comment was marked as resolved.

colindean marked this conversation as resolved.
Show resolved Hide resolved
- Drops support for all Python versions earlier than 3.7, including 2.7.


v1.2.13 (2021-09-05)
====================
Expand Down
45 changes: 23 additions & 22 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,12 @@
# What Python version is installed where:
# http://www.appveyor.com/docs/installed-software#python

# Deprecated's package version, sync with setup.py
version: 1.2.14.{build}
# Explicitly set base image to use
image: Visual Studio 2022

environment:
matrix:
# Python **2.6** and **3.3** are no more supported
- PYTHON: "C:\\Python27"
TOX_ENV: "py27"

- PYTHON: "C:\\Python27-x64"
TOX_ENV: "py27"

- PYTHON: "C:\\Python35"
TOX_ENV: "py35"

- PYTHON: "C:\\Python35-x64"
TOX_ENV: "py35"

- PYTHON: "C:\\Python36"
TOX_ENV: "py36"

- PYTHON: "C:\\Python36-x64"
TOX_ENV: "py36"

# What Python version is installed where:
# https://www.appveyor.com/docs/windows-images-software/#python
- PYTHON: "C:\\Python37"
TOX_ENV: "py37"

Expand All @@ -36,6 +19,24 @@ environment:
- PYTHON: "C:\\Python38-x64"
TOX_ENV: "py38"

- PYTHON: "C:\\Python39"
TOX_ENV: "py39"

- PYTHON: "C:\\Python39-x64"
TOX_ENV: "py39"

- PYTHON: "C:\\Python310"
TOX_ENV: "py310"

- PYTHON: "C:\\Python310-x64"
TOX_ENV: "py310"

- PYTHON: "C:\\Python311"
TOX_ENV: "py311"

- PYTHON: "C:\\Python311-x64"
TOX_ENV: "py311"

init:
- set PATH=%PYTHON%;%PYTHON%\Scripts;C:\MinGW\msys\1.0\bin;%PATH%
- "git config --system http.sslcainfo \"C:\\Program Files\\Git\\mingw64\\ssl\\certs\\ca-bundle.crt\""
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tool.black]
line-length = 120
skip-string-normalization = true
target-version = ['py27', 'py34', 'py35', 'py36', 'py37', 'py38']
target-version = ['py37', 'py38', 'py39', 'py310', 'py311']
include = '\.pyi?$'

[tool.isort]
Expand Down
22 changes: 5 additions & 17 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,34 +169,22 @@ def function_three():
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
Comment on lines -172 to -177
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since the base code of this library has no change, I don't wan't to drop those versions.

'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 :: 3.12',
'Topic :: Software Development :: Libraries :: Python Modules',
],
extras_require={
'dev': [
'tox',
'PyTest ; python_version >= "3.6"',
'PyTest < 5 ; python_version < "3.6"',
'PyTest-Cov ; python_version >= "3.6"',
'PyTest-Cov < 2.6 ; python_version < "3.6"',
'PyTest',
'PyTest-Cov',
'bump2version < 1',
'sphinx < 2',
# Python 2.7 EOL:
'importlib-metadata < 3 ; python_version < "3"',
'importlib-resources < 4 ; python_version < "3"',
'configparser < 5 ; python_version < "3"',
'sphinxcontrib-websupport < 2 ; python_version < "3"',
'zipp < 2 ; python_version < "3"',
]
},
python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*',
python_requires='>=3.7',
Comment on lines -201 to +189
Copy link
Collaborator

Choose a reason for hiding this comment

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

No, I want to keep this unchanged.

From my point of view, the reason that it is no longer possible to run unit tests with the recent tools is not a reason to abandon the support of Python 2.7 and the older versions of Python 3. If a user has an old development environment, he will be able to install and use the library.

Copy link

Choose a reason for hiding this comment

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

But surely they could continue using the older releases of this package, if they still rely on python 2.7?

It won't break any user if they are stuck on an older version, because other packages are also not moving and there is no support/security-fixes anyways?

Choose a reason for hiding this comment

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

This PR does not change the code base, so the code remains compatible with older versions of Python. I don't want to make a major release for this PR: it's only a build fix.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If you're OK with allowing installation on an untested Python version, I'll revert the versions drop. I myself would not want to receive reports about any future failure on untested and EOL versions but I recognize the risk of breakage is low given that this library doesn't need to change much.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Researching a little deeper, I could retain testing on the older versions by switching the base platform for testing to

  • ubuntu-20.04 for 3.6 & 3.5
  • ubuntu-18.04 for 3.4
  • simply re-add 2.7 because there's a package for ubuntu-22.04 (which is ubuntu-latest) for 2.7.18

all of these per https://github.com/actions/python-versions/blob/main/versions-manifest.json

Looks like I can also enable 3.12.0-alpha - 3.12.0 through the semver hyphen ranges.

Copy link
Contributor

Choose a reason for hiding this comment

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

2.7 is being removed in a couple of weeks actions/runner-images#7401

Instead of 3.12.0-alpha - 3.12.0, we can use the simpler 3.12-dev. https://github.com/actions/setup-python/blob/main/docs/advanced-usage.md#using-the-python-version-input

Copy link
Collaborator

Choose a reason for hiding this comment

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

Researching a little deeper, I could retain testing on the older versions by switching the base platform for testing to

  • ubuntu-20.04 for 3.6 & 3.5

  • ubuntu-18.04 for 3.4

  • simply re-add 2.7 because there's a package for ubuntu-22.04 (which is ubuntu-latest) for 2.7.18

all of these per https://github.com/actions/python-versions/blob/main/versions-manifest.json

Looks like I can also enable 3.12.0-alpha - 3.12.0 through the semver hyphen ranges.

I am OK with that.

)
21 changes: 10 additions & 11 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,31 @@

[tox]
# PyPy configuration (on Linux/OSX):
# - /usr/local/bin/pypy -> /opt/pypy2.7-v7.3.0-osx64/bin/pypy
# - /usr/local/bin/pypy3 -> /opt/pypy3.6-v7.3.0-osx64/bin/pypy3
envlist =
py{27,34,35,36,37,38,39,310}-wrapt{1.10,1.11,1.12,1.13}
pypy, pypy3
py{37,38,39,310}-wrapt{1.10,1.11,1.12,1.13,1.14}
py{311,312}-wrapt{1.14}
Comment on lines +13 to +14
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to test five versions of wrapt? 1.10 is from 2017, pretty old by now.

If we're adding two, shall we remove two?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Support table:

Wrapt version° Pythons supported
1.10.x 2.6, 2.7, 3.3, 3.4, 3.5, 3.6
1.11.x 2.6, 2.7, 3.3, 3.4, 3.5, 3.6, 3.7
1.12.x 2.7, 3.4, 3.5, 3.6, 3.7, 3.8
1.13.x 2.7, 3.5, 3.6, 3.7, 3.8, 3.9, 3.10
1.14.x 2.7, 3.5, 3.6, 3.7, 3.8, 3.9, 3.10, 3.11
1.15.x rc 2.7, 3.5, 3.6, 3.7, 3.8, 3.9, 3.10, 3.11

It looks very safe to drop 1.10 because none of its supported versions would be supported in the next Deprecated release if this PR is merged. I'd call it safe enough to drop 1.11-1.12 and probably even 1.13, tbh.

°: latest in series

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'd say let's keep the wrapt dep and testing at 1.10+ for this PR and if I have time this week (long shot), I can do the work to eliminate 1.10-1.13 to settle on 1.14+.

pypy3
docs

[testenv]
commands = pytest --cov-report term-missing --cov=deprecated tests/
deps =
py27,py34,py35: pip >= 9.0.3, < 21
py27,py34: PyTest < 5
py35,py36,py37,py38,py39,pypy,pypy3: PyTest
py27,py34: PyTest-Cov < 2.6
py34: typing # required by pytest->attrs
py35,py36,py37,py38,py39,py310,pypy,pypy3: PyTest-Cov
py{37,38,39,310,311,312,py3}: PyTest
py{37,38,39,310,311,312,py3}: PyTest-Cov
wrapt1.10: wrapt ~= 1.10.0
wrapt1.11: wrapt ~= 1.11.0
wrapt1.12: wrapt ~= 1.12.0
wrapt1.13: wrapt == 1.13.0rc3
coverage < 5
wrapt1.13: wrapt ~= 1.13.0
wrapt1.14: wrapt ~= 1.14.0
coverage

[testenv:docs]
basepython = python
# jinja2 3.0.3 was the last version to have contextfunction that sphinx 1.x needs
deps =
sphinx < 2
jinja2 == 3.0.3
commands =
sphinx-build -b html -d {envtmpdir}/doctrees docs/source/ {envtmpdir}/html
sphinx-build -b epub -d {envtmpdir}/doctrees docs/source/ {envtmpdir}/epub