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

Clean-up typing_extensions after support dropped for older Pythons #892

Closed
wants to merge 36 commits into from
Closed
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
9e3bb9f
Drop Python 2.7 support
AA-Turner Sep 15, 2021
04975cb
Unconditional _collections_abc._check_methods import
AA-Turner Sep 15, 2021
6335d40
HAVE_PROTOCOLS is True on all supported versions
AA-Turner Sep 15, 2021
953377b
Remove sys.version_info gates on unsupported versions
AA-Turner Sep 15, 2021
f15f072
Remove TYPING_3_5_* gates
AA-Turner Sep 15, 2021
0ae1d87
Remove SUBCLASS_CHECK_FORBIDDEN gates
AA-Turner Sep 15, 2021
75d7ad6
Remove ASYNCIO gates
AA-Turner Sep 15, 2021
d0ad757
Remove PY36 gates
AA-Turner Sep 15, 2021
2a6e7c4
Remove HAVE_PROTOCOLS gate
AA-Turner Sep 15, 2021
195298e
Remove remaining sys.version_info gates
AA-Turner Sep 15, 2021
6543f32
Remove unneeded conditionals in test-requirements.txt
AA-Turner Sep 15, 2021
6cbb269
Address flake8 warnings
AA-Turner Sep 15, 2021
7f5ef16
Unconditionally import where possible
AA-Turner Sep 15, 2021
da3cb1a
_geqv was removed in Python 3.6
AA-Turner Sep 15, 2021
6e3a2c6
Unconditionally define values where possible
AA-Turner Sep 15, 2021
20a6d54
Remove now unused _define_guard
AA-Turner Sep 15, 2021
1c39b62
Remove OLD_GENERICS
AA-Turner Sep 15, 2021
561d3f6
Use f-strings
AA-Turner Sep 15, 2021
73d4a9b
Use new style super()
AA-Turner Sep 15, 2021
8d4af80
Add python-requires and license-files to setup.py
AA-Turner Sep 15, 2021
209db79
Add Python 3.7+ types to README.rst
AA-Turner Sep 15, 2021
ab4268e
Names will always exist
AA-Turner Sep 15, 2021
b51bc69
Use f-strings in tests
AA-Turner Sep 15, 2021
442cf47
Use !r in f-strings
AA-Turner Sep 16, 2021
34d8598
Update wording in CONTRIBUTING.md
AA-Turner Sep 16, 2021
2b8f020
Inline _generic_new
AA-Turner Sep 16, 2021
c633647
Inline typing imports
AA-Turner Sep 16, 2021
6abe94b
Remove unused type variables
AA-Turner Sep 16, 2021
08aa960
Localise helper imports
AA-Turner Sep 16, 2021
2d1bc41
Pick up unchanged .formats -> f-strings
AA-Turner Sep 16, 2021
3980658
Inline TypingMeta
AA-Turner Sep 16, 2021
cf52c17
Swap Protocol definitions for 3.6 and 3.7 for consistency with all ot…
AA-Turner Sep 16, 2021
9542687
Inline _tp_cache, _TypingEllipsis, _TypingEmpty
AA-Turner Sep 16, 2021
b06ec35
Localise imports for modules only used once
AA-Turner Sep 16, 2021
b0a1d8e
Inline _GenericAlias
AA-Turner Sep 16, 2021
942f343
Fix a typo
AA-Turner Sep 16, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 0 additions & 2 deletions .flake8
@@ -1,7 +1,5 @@
[flake8]

# fake builtins for python2/*
builtins = basestring, unicode
max-line-length = 90
ignore =
# irrelevant plugins
Expand Down
2 changes: 0 additions & 2 deletions .flake8-tests
Expand Up @@ -6,8 +6,6 @@
# This will be possibly merged in the future.

[flake8]
# fake builtins for python2/*
builtins = basestring, unicode
max-line-length = 100
ignore =
# temporary ignores until we sort it out
Expand Down
11 changes: 3 additions & 8 deletions CONTRIBUTING.md
Expand Up @@ -18,11 +18,10 @@ standard library, so that users can experiment with them before they are added t
standard library. Such features should ideally already be specified in a PEP or draft
PEP.

`typing_extensions` still supports all Python versions supported by `typing`, down to
Python 2.7 and 3.4. However, it is OK to omit support for Python versions that have
`typing_extensions` supports Python 3.6+. However, it is OK to omit support for Python versions that have
reached end of life if doing so is too difficult or otherwise does not make sense. For
example, `typing_extensions.AsyncGenerator` only exists on Python 3.6 and higher,
because async generators were added to the language in 3.6.
example, `typing_extensions.AsyncGenerator` was only supported in Python 3.6 and newer, because async
generators were not part of the language before then.

# Versioning scheme

Expand All @@ -41,12 +40,8 @@ new release that doesn't include any new standard library features would be call
- Build the source and wheel distributions:

- `pip3 install -U setuptools wheel`
- `pip2 install -U setuptools wheel`
- `rm -rf dist/ build/`
- `python3 setup.py sdist bdist_wheel`
- `rm -rf build/` (Works around
`a Wheel bug <https://bitbucket.org/pypa/wheel/issues/147/bdist_wheel-should-start-by-cleaning-up>`\_)
- `python2 setup.py bdist_wheel`

- Install the built distributions locally and test (if you were using `tox`, you already
tested the source distribution).
Expand Down
9 changes: 4 additions & 5 deletions test-requirements.txt
@@ -1,5 +1,4 @@
flake8; python_version >= '3.6'
flake8-bugbear; python_version >= '3.6'
flake8-pyi; python_version >= '3.6'
pytest==4.6.11; python_version < '3.0'
pytest; python_version >= '3.0'
flake8
flake8-bugbear
flake8-pyi
pytest
10 changes: 9 additions & 1 deletion typing_extensions/README.rst
Expand Up @@ -43,7 +43,7 @@ This module currently contains the following:
- ``Literal``
- ``NewType``
- ``NoReturn``
- ``overload`` (note that older versions of ``typing`` only let you use ``overload`` in stubs)
- ``overload``
- ``OrderedDict``
- ``ParamSpec``
- ``ParamSpecArgs``
Expand All @@ -57,6 +57,14 @@ This module currently contains the following:
- ``TypeGuard``
- ``TYPE_CHECKING``

Python 3.7+
-----------

- ``get_origin``
- ``get_args``
- ``get_type_hints``


Other Notes and Limitations
===========================

Expand Down
5 changes: 0 additions & 5 deletions typing_extensions/setup.cfg

This file was deleted.

7 changes: 3 additions & 4 deletions typing_extensions/setup.py
@@ -1,13 +1,10 @@
#!/usr/bin/env python
# coding: utf-8

import sys
from setuptools import setup

if sys.version_info < (3, 6, 0):
sys.stderr.write('ERROR: You need Python 3.6+ '
'to install typing_extensions.\n')
exit(1)
sys.exit('ERROR: You need Python 3.6+ to install typing_extensions.\n')

version = '3.10.0.2'
description = 'Backported and Experimental Type Hints for Python 3.6+'
Expand Down Expand Up @@ -47,9 +44,11 @@
author_email='levkivskyi@gmail.com',
url='https://github.com/python/typing/blob/master/typing_extensions/README.rst',
license='PSF',
license_files=["LICENSE"],
keywords='typing function annotations type hints hinting checking '
'checker typehints typehinting typechecking backport',
package_dir={'': 'src_py3'},
py_modules=['typing_extensions'],
python_requires=">=3.6",
classifiers=classifiers,
)