Skip to content

Commit f1a2a39

Browse files
Michael Howitzdataflake
andauthored
Drop support for Python 2.7, 3.5, 3.6. (#266)
Co-authored-by: Jens Vagelpohl <[email protected]>
1 parent f05a16b commit f1a2a39

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+692
-1848
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -96,24 +96,16 @@ jobs:
9696
fail-fast: false
9797
matrix:
9898
python-version:
99-
- "2.7"
100-
- "3.5"
101-
- "pypy-2.7"
10299
- "pypy-3.7"
103-
- "3.6"
104100
- "3.7"
105101
- "3.8"
106102
- "3.9"
107103
- "3.10"
108104
- "3.11"
109105
os: [ubuntu-20.04, macos-latest]
110106
exclude:
111-
- os: macos-latest
112-
python-version: "pypy-2.7"
113107
- os: macos-latest
114108
python-version: "pypy-3.7"
115-
- os: macos-latest
116-
python-version: "3.5"
117109

118110
steps:
119111
- name: checkout
@@ -141,15 +133,7 @@ jobs:
141133
restore-keys: |
142134
${{ runner.os }}-pip-
143135
144-
- name: Install Build Dependencies (PyPy2)
145-
if: >
146-
startsWith(matrix.python-version, 'pypy-2.7')
147-
run: |
148-
pip install -U pip
149-
pip install -U setuptools wheel twine "cffi != 1.15.1"
150-
- name: Install Build Dependencies (other Python versions)
151-
if: >
152-
!startsWith(matrix.python-version, 'pypy-2.7')
136+
- name: Install Build Dependencies
153137
run: |
154138
pip install -U pip
155139
pip install -U setuptools wheel twine cffi
@@ -158,9 +142,6 @@ jobs:
158142
if: >
159143
startsWith(runner.os, 'Mac')
160144
&& !(startsWith(matrix.python-version, 'pypy')
161-
|| matrix.python-version == '2.7'
162-
|| matrix.python-version == '3.5'
163-
|| matrix.python-version == '3.6'
164145
|| matrix.python-version == '3.7')
165146
env:
166147
MACOSX_DEPLOYMENT_TARGET: 10.9
@@ -175,9 +156,6 @@ jobs:
175156
if: >
176157
startsWith(runner.os, 'Mac')
177158
&& !(startsWith(matrix.python-version, 'pypy')
178-
|| matrix.python-version == '2.7'
179-
|| matrix.python-version == '3.5'
180-
|| matrix.python-version == '3.6'
181159
|| matrix.python-version == '3.7')
182160
env:
183161
MACOSX_DEPLOYMENT_TARGET: 11.0
@@ -192,9 +170,6 @@ jobs:
192170
if: >
193171
!startsWith(runner.os, 'Mac')
194172
|| startsWith(matrix.python-version, 'pypy')
195-
|| matrix.python-version == '2.7'
196-
|| matrix.python-version == '3.5'
197-
|| matrix.python-version == '3.6'
198173
|| matrix.python-version == '3.7'
199174
run: |
200175
# Next, build the wheel *in place*. This helps ccache, and also lets us cache the configure
@@ -205,7 +180,6 @@ jobs:
205180
- name: Install zope.interface and dependencies
206181
run: |
207182
# Install to collect dependencies into the (pip) cache.
208-
pip install -U 'faulthandler; python_version == "2.7" and platform_python_implementation == "CPython"'
209183
pip install .[test]
210184
211185
- name: Check zope.interface build
@@ -223,9 +197,6 @@ jobs:
223197
if: >
224198
startsWith(runner.os, 'Mac')
225199
&& !(startsWith(matrix.python-version, 'pypy')
226-
|| matrix.python-version == '2.7'
227-
|| matrix.python-version == '3.5'
228-
|| matrix.python-version == '3.6'
229200
|| matrix.python-version == '3.7')
230201
uses: actions/upload-artifact@v3
231202
with:
@@ -262,24 +233,16 @@ jobs:
262233
fail-fast: false
263234
matrix:
264235
python-version:
265-
- "2.7"
266-
- "3.5"
267-
- "pypy-2.7"
268236
- "pypy-3.7"
269-
- "3.6"
270237
- "3.7"
271238
- "3.8"
272239
- "3.9"
273240
- "3.10"
274241
- "3.11"
275242
os: [ubuntu-20.04, macos-latest]
276243
exclude:
277-
- os: macos-latest
278-
python-version: "pypy-2.7"
279244
- os: macos-latest
280245
python-version: "pypy-3.7"
281-
- os: macos-latest
282-
python-version: "3.5"
283246

284247
steps:
285248
- name: checkout
@@ -320,7 +283,6 @@ jobs:
320283
run: |
321284
pip install -U wheel
322285
pip install -U --no-binary :all: coverage
323-
pip install -U 'faulthandler; python_version == "2.7" and platform_python_implementation == "CPython"'
324286
# Unzip into src/ so that testrunner can find the .so files
325287
# when we ask it to load tests from that directory. This
326288
# might also save some build time?
@@ -495,8 +457,6 @@ jobs:
495457
# An alternate way to do this is to run the container directly with a uses:
496458
# and then the script runs inside it. That may work better with caching.
497459
# See https://github.com/pyca/bcrypt/blob/f6b5ee2eda76d077c531362ac65e16f045cf1f29/.github/workflows/wheel-builder.yml
498-
# The 2010 image is the most recent spec that comes with Python 2.7,
499-
# and only up through the tag 2021-02-06-3d322a5
500460
env:
501461
DOCKER_IMAGE: quay.io/pypa/${{ matrix.image }}
502462
run: |

.manylinux-install.sh

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@ yum -y install libffi-devel
2828

2929
tox_env_map() {
3030
case $1 in
31-
*"cp27"*) echo 'py27';;
32-
*"cp35"*) echo 'py35';;
33-
*"cp36"*) echo 'py36';;
3431
*"cp37"*) echo 'py37';;
3532
*"cp38"*) echo 'py38';;
3633
*"cp39"*) echo 'py39';;
@@ -43,10 +40,7 @@ tox_env_map() {
4340
# Compile wheels
4441
for PYBIN in /opt/python/*/bin; do
4542
if \
46-
[[ "${PYBIN}" == *"cp27"* ]] || \
47-
[[ "${PYBIN}" == *"cp35"* ]] || \
4843
[[ "${PYBIN}" == *"cp311"* ]] || \
49-
[[ "${PYBIN}" == *"cp36"* ]] || \
5044
[[ "${PYBIN}" == *"cp37"* ]] || \
5145
[[ "${PYBIN}" == *"cp38"* ]] || \
5246
[[ "${PYBIN}" == *"cp39"* ]] || \

.meta.toml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22
# https://github.com/zopefoundation/meta/tree/master/config/c-code
33
[meta]
44
template = "c-code"
5-
commit-id = "342271a70d886e753e5cc629e8a81b3cfab692ac"
5+
commit-id = "be727608"
66

77
[python]
88
with-appveyor = true
99
with-pypy = true
10-
with-legacy-python = true
1110
with-sphinx-doctests = true
1211
with-windows = false
1312
with-future-python = false
@@ -26,7 +25,7 @@ testenv-setenv = [
2625
]
2726
coverage-command = "coverage combine"
2827
coverage-additional = [
29-
"depends = py27,py27-pure,py35,py35-pure,py36,py36-pure,py37,py37-pure,py38,py38-pure,py39,py39-pure,py310,py310-pure,pypy,pypy3,docs",
28+
"depends = py37,py37-pure,py38,py38-pure,py39,py39-pure,py310,py310-pure,py311,py311-pure,pypy,pypy3,docs",
3029
"parallel_show_output = true",
3130
]
3231

@@ -63,7 +62,6 @@ additional-install = [
6362
" run: |",
6463
" pip install -U wheel",
6564
" pip install -U --no-binary :all: coverage",
66-
" pip install -U 'faulthandler; python_version == \"2.7\" and platform_python_implementation == \"CPython\"'",
6765
" # Unzip into src/ so that testrunner can find the .so files",
6866
" # when we ask it to load tests from that directory. This",
6967
" # might also save some build time?",

CHANGES.rst

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,18 @@
22
Changes
33
=========
44

5-
5.5.3 (unreleased)
6-
==================
5+
6.0 (unreleased)
6+
================
7+
8+
- Drop support for Python 2.7, 3.5, 3.6.
79

810
- Fix test deprecation warning on Python 3.11.
911

12+
- Drop:
13+
14+
+ `zope.interface.implements`
15+
+ `zope.interface.implementsOnly`
16+
+ `zope.interface.classProvides`
1017

1118
5.5.2 (2022-11-17)
1219
==================

appveyor.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ environment:
1010
secure: aoZC/+rvJKg8B5GMGIxd1X2q2bz7SMl8G3810BID9U8PXFqM0FbWaK9fZ9qcU0UyG2xJsK56Fb6+L6g27I0Lg8UFNhlU1zLAuMSgJQbHsqawFgSY067IdJB68pp34d/oEyxMrJvAKENHH77Fe4KGDssLlk5WnnYS3DA9b66p5imP+1DTtkq5/gMtoG4nZTBtVos7J2kkYTQ5t4BjzTQxPMC3bStNnvuuB0orX4AoCyTrOR1wdZFiNKLzbVnrJCNn24t/n3kG9WrxbnKlrbOm4A==
1111

1212
matrix:
13-
- python: 27-x64
14-
- python: 35-x64
15-
- python: 36-x64
1613
- python: 37-x64
1714
- python: 38-x64
1815
- python: 39-x64

docs/api/declarations.rst

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -515,33 +515,6 @@ When registering an adapter or utility component, the registry looks for the
515515
provided.
516516

517517

518-
Deprecated Functions
519-
--------------------
520-
521-
implements
522-
~~~~~~~~~~
523-
524-
.. caution:: Does not work on Python 3. Use the `implementer` decorator instead.
525-
526-
.. autofunction:: implements
527-
528-
529-
implementsOnly
530-
~~~~~~~~~~~~~~
531-
532-
.. caution:: Does not work on Python 3. Use the `implementer_only` decorator instead.
533-
534-
.. autofunction:: implementsOnly
535-
536-
537-
classProvides
538-
~~~~~~~~~~~~~
539-
540-
.. caution:: Does not work on Python 3. Use the `provider` decorator instead.
541-
542-
.. autofunction:: classProvides
543-
544-
545518
Querying The Interfaces Of Objects
546519
==================================
547520

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Generated from:
22
# https://github.com/zopefoundation/meta/tree/master/config/c-code
33
[bdist_wheel]
4-
universal = 1
4+
universal = 0
55

66
[zest.releaser]
77
create-wheel = no

setup.py

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def read(*rnames):
100100
)
101101

102102
setup(name='zope.interface',
103-
version='5.5.3.dev0',
103+
version='6.0.dev0',
104104
url='https://github.com/zopefoundation/zope.interface',
105105
license='ZPL 2.1',
106106
description='Interfaces for Python',
@@ -113,11 +113,7 @@ def read(*rnames):
113113
"License :: OSI Approved :: Zope Public License",
114114
"Operating System :: OS Independent",
115115
"Programming Language :: Python",
116-
"Programming Language :: Python :: 2",
117-
"Programming Language :: Python :: 2.7",
118116
"Programming Language :: Python :: 3",
119-
"Programming Language :: Python :: 3.5",
120-
"Programming Language :: Python :: 3.6",
121117
"Programming Language :: Python :: 3.7",
122118
"Programming Language :: Python :: 3.8",
123119
"Programming Language :: Python :: 3.9",
@@ -139,14 +135,7 @@ def read(*rnames):
139135
zip_safe=False,
140136
tests_require=tests_require,
141137
install_requires=['setuptools'],
142-
python_requires=', '.join([
143-
'>=2.7',
144-
'!=3.0.*',
145-
'!=3.1.*',
146-
'!=3.2.*',
147-
'!=3.3.*',
148-
'!=3.4.*',
149-
]),
138+
python_requires='>=3.7',
150139
extras_require={
151140
'docs': ['Sphinx', 'repoze.sphinx.autointerface'],
152141
'test': tests_require,

src/zope/interface/__init__.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,11 @@ def meth(arg1, arg2):
6262
from zope.interface.declarations import classImplements
6363
from zope.interface.declarations import classImplementsFirst
6464
from zope.interface.declarations import classImplementsOnly
65-
from zope.interface.declarations import classProvides
6665
from zope.interface.declarations import directlyProvidedBy
6766
from zope.interface.declarations import directlyProvides
6867
from zope.interface.declarations import implementedBy
6968
from zope.interface.declarations import implementer
7069
from zope.interface.declarations import implementer_only
71-
from zope.interface.declarations import implements
72-
from zope.interface.declarations import implementsOnly
7370
from zope.interface.declarations import moduleProvides
7471
from zope.interface.declarations import named
7572
from zope.interface.declarations import noLongerProvides

src/zope/interface/_compat.py

Lines changed: 6 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -20,51 +20,16 @@
2020
"""
2121
import os
2222
import sys
23-
import types
2423

25-
if sys.version_info[0] < 3:
2624

27-
def _normalize_name(name):
28-
if isinstance(name, basestring):
29-
return unicode(name)
30-
raise TypeError("name must be a regular or unicode string")
31-
32-
CLASS_TYPES = (type, types.ClassType)
33-
STRING_TYPES = (basestring,)
34-
35-
_BUILTINS = '__builtin__'
36-
37-
PYTHON3 = False
38-
PYTHON2 = True
39-
40-
else:
41-
42-
def _normalize_name(name):
43-
if isinstance(name, bytes):
44-
name = str(name, 'ascii')
45-
if isinstance(name, str):
46-
return name
47-
raise TypeError("name must be a string or ASCII-only bytes")
48-
49-
CLASS_TYPES = (type,)
50-
STRING_TYPES = (str,)
51-
52-
_BUILTINS = 'builtins'
53-
54-
PYTHON3 = True
55-
PYTHON2 = False
25+
def _normalize_name(name):
26+
if isinstance(name, bytes):
27+
name = str(name, 'ascii')
28+
if isinstance(name, str):
29+
return name
30+
raise TypeError("name must be a string or ASCII-only bytes")
5631

5732
PYPY = hasattr(sys, 'pypy_version_info')
58-
PYPY2 = PYTHON2 and PYPY
59-
60-
def _skip_under_py3k(test_method):
61-
import unittest
62-
return unittest.skipIf(sys.version_info[0] >= 3, "Only on Python 2")(test_method)
63-
64-
65-
def _skip_under_py2(test_method):
66-
import unittest
67-
return unittest.skipIf(sys.version_info[0] < 3, "Only on Python 3")(test_method)
6833

6934

7035
def _c_optimizations_required():

0 commit comments

Comments
 (0)