Skip to content

Commit 5cc1d2c

Browse files
authored
Drop Python 2 support for typing_extensions (#893)
Update README accordingly
1 parent 17fe6c4 commit 5cc1d2c

File tree

8 files changed

+22
-819
lines changed

8 files changed

+22
-819
lines changed

.flake8

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,4 @@ ignore =
1414
exclude =
1515
# tests have more relaxed formatting rules
1616
# and its own specific config in .flake8-tests
17-
typing_extensions/src_py2/test_typing_extensions.py,
1817
typing_extensions/src_py3/test_typing_extensions.py,

.github/workflows/ci.yml

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,6 @@ permissions:
88
contents: read
99

1010
jobs:
11-
tests-27:
12-
name: Run tests (2.7)
13-
runs-on: ubuntu-latest
14-
15-
steps:
16-
- uses: actions/checkout@v2
17-
18-
- name: Set up Python
19-
uses: actions/setup-python@v2
20-
with:
21-
python-version: 2.7
22-
23-
- name: Install dependencies
24-
run: |
25-
python -m pip install --upgrade pip
26-
pip install -r test-requirements.txt
27-
28-
- name: Test typing_extensions
29-
run: |
30-
pip install typing
31-
pytest typing_extensions/src_py2
32-
3311
tests:
3412
name: Run tests
3513

@@ -94,4 +72,4 @@ jobs:
9472
run: flake8
9573

9674
- name: Lint tests
97-
run: flake8 --config=.flake8-tests typing_extensions/src_py2/test_typing_extensions.py typing_extensions/src_py3/test_typing_extensions.py
75+
run: flake8 --config=.flake8-tests typing_extensions/src_py3/test_typing_extensions.py

typing_extensions/MANIFEST.in

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
include LICENSE README.rst
22
include src_py3/typing_extensions.py
33
include src_py3/test_typing_extensions.py
4-
include src_py2/typing_extensions.py
5-
include src_py2/test_typing_extensions.py

typing_extensions/README.rst

Lines changed: 16 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,7 @@ Typing Extensions
99
Overview
1010
========
1111

12-
The ``typing`` module was added to the standard library in Python 3.5 on
13-
a provisional basis and will no longer be provisional in Python 3.7. However,
14-
this means users of Python 3.5 - 3.6 who are unable to upgrade will not be
15-
able to take advantage of new types added to the ``typing`` module, such as
16-
``typing.Text`` or ``typing.Coroutine``.
17-
18-
The ``typing_extensions`` module contains both backports of these changes
12+
The ``typing_extensions`` module contains both backports of ``typing`` features
1913
as well as experimental types that will eventually be added to the ``typing``
2014
module, such as ``Protocol`` (see PEP 544 for details about protocols and
2115
static duck typing) or ``TypedDict`` (see PEP 589).
@@ -30,11 +24,17 @@ Included items
3024

3125
This module currently contains the following:
3226

33-
All Python versions:
34-
--------------------
35-
27+
- ``Annotated``
28+
- ``AsyncContextManager``
29+
- ``AsyncGenerator``
30+
- ``AsyncIterable``
31+
- ``AsyncIterator``
32+
- ``Awaitable``
33+
- ``ChainMap``
3634
- ``ClassVar``
35+
- ``Concatenate``
3736
- ``ContextManager``
37+
- ``Coroutine``
3838
- ``Counter``
3939
- ``DefaultDict``
4040
- ``Deque``
@@ -45,38 +45,17 @@ All Python versions:
4545
- ``NoReturn``
4646
- ``overload`` (note that older versions of ``typing`` only let you use ``overload`` in stubs)
4747
- ``OrderedDict``
48-
- ``Protocol`` (except on Python 3.5.0)
49-
- ``runtime_checkable`` (except on Python 3.5.0)
48+
- ``ParamSpec``
49+
- ``ParamSpecArgs``
50+
- ``ParamSpecKwargs``
51+
- ``Protocol``
52+
- ``runtime_checkable``
5053
- ``Text``
5154
- ``Type``
5255
- ``TypedDict``
5356
- ``TypeAlias``
54-
- ``TYPE_CHECKING``
55-
56-
Python 3.4+ only:
57-
-----------------
58-
59-
- ``ChainMap``
60-
- ``ParamSpec``
61-
- ``Concatenate``
62-
- ``ParamSpecArgs``
63-
- ``ParamSpecKwargs``
6457
- ``TypeGuard``
65-
66-
Python 3.5+ only:
67-
-----------------
68-
69-
- ``Annotated`` (except on Python 3.5.0-3.5.2)
70-
- ``AsyncIterable``
71-
- ``AsyncIterator``
72-
- ``AsyncContextManager``
73-
- ``Awaitable``
74-
- ``Coroutine``
75-
76-
Python 3.6+ only:
77-
-----------------
78-
79-
- ``AsyncGenerator``
58+
- ``TYPE_CHECKING``
8059

8160
Other Notes and Limitations
8261
===========================
@@ -101,4 +80,3 @@ To run tests, navigate into the appropriate source directory and run
10180
``test_typing_extensions.py``. You will also need to install the latest
10281
version of ``typing`` if you are using a version of Python that does not
10382
include ``typing`` as a part of the standard library.
104-

typing_extensions/setup.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
import sys
55
from setuptools import setup
66

7-
if sys.version_info < (2, 7, 0) or (3, 0, 0) <= sys.version_info < (3, 6, 0):
8-
sys.stderr.write('ERROR: You need Python 2.7 or 3.6+ '
7+
if sys.version_info < (3, 6, 0):
8+
sys.stderr.write('ERROR: You need Python 3.6+ '
99
'to install typing_extensions.\n')
1010
exit(1)
1111

@@ -31,7 +31,6 @@
3131
'Intended Audience :: Developers',
3232
'License :: OSI Approved :: Python Software Foundation License',
3333
'Operating System :: OS Independent',
34-
'Programming Language :: Python :: 2.7',
3534
'Programming Language :: Python :: 3.6',
3635
'Programming Language :: Python :: 3.7',
3736
'Programming Language :: Python :: 3.8',
@@ -40,13 +39,6 @@
4039
'Topic :: Software Development',
4140
]
4241

43-
if sys.version_info.major == 2:
44-
package_dir = 'src_py2'
45-
elif sys.version_info.major == 3:
46-
package_dir = 'src_py3'
47-
else:
48-
raise AssertionError()
49-
5042
setup(name='typing_extensions',
5143
version=version,
5244
description=description,
@@ -57,7 +49,7 @@
5749
license='PSF',
5850
keywords='typing function annotations type hints hinting checking '
5951
'checker typehints typehinting typechecking backport',
60-
package_dir={'': package_dir},
52+
package_dir={'': 'src_py3'},
6153
py_modules=['typing_extensions'],
6254
classifiers=classifiers,
63-
install_requires=["typing >= 3.7.4; python_version < '3.5'"])
55+
)

0 commit comments

Comments
 (0)