Skip to content

Commit 9a5c865

Browse files
authored
Drop support for Python 3.6, part 1 (#8250)
* Document that typeshed support 3.7+. * Don't run tests on Python 3.6. * Remove Python 3.6 allow lists. * Merge common allowlist items. Part of #6189
1 parent 9ccf458 commit 9a5c865

27 files changed

+52
-411
lines changed

.github/workflows/daily.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
matrix:
2222
# macos-11 does not have tcl/tk installed, needed for stubtesting tkinter
2323
os: ["ubuntu-latest", "windows-latest", "macos-10.15"]
24-
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11-dev"]
24+
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11-dev"]
2525
fail-fast: false
2626

2727
steps:
@@ -49,7 +49,7 @@ jobs:
4949
- uses: actions/checkout@v3
5050
- uses: actions/setup-python@v4
5151
with:
52-
python-version: 3.9
52+
python-version: "3.9"
5353
- name: Install dependencies
5454
run: pip install $(grep tomli== requirements-tests.txt) termcolor
5555
- name: Install apt packages

.github/workflows/stubtest_stdlib.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
matrix:
2828
# macos-11 does not have tcl/tk installed, needed for stubtesting tkinter
2929
os: ["ubuntu-latest", "windows-latest", "macos-10.15"]
30-
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11-dev"]
30+
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11-dev"]
3131
fail-fast: false
3232

3333
steps:

.github/workflows/tests.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
strategy:
6767
matrix:
6868
platform: ["linux", "win32", "darwin"]
69-
python-version: ["2.7", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]
69+
python-version: ["2.7", "3.7", "3.8", "3.9", "3.10", "3.11"]
7070
fail-fast: false
7171
steps:
7272
- uses: actions/checkout@v3
@@ -82,7 +82,7 @@ jobs:
8282
strategy:
8383
matrix:
8484
python-platform: ["Linux", "Windows", "Darwin"]
85-
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]
85+
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
8686
fail-fast: false
8787
env:
8888
PYRIGHT_VERSION: 1.1.255 # Must match pyright_test.py.
@@ -112,7 +112,7 @@ jobs:
112112
fetch-depth: 0
113113
- uses: actions/setup-python@v4
114114
with:
115-
python-version: 3.9
115+
python-version: "3.9"
116116
- name: Install dependencies
117117
run: pip install $(grep tomli== requirements-tests.txt) termcolor
118118
- name: Run stubtest

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ contributors can be found in [CONTRIBUTING.md](CONTRIBUTING.md). **Please read
1717
it before submitting pull requests; do not report issues with annotations to
1818
the project the stubs are for, but instead report them here to typeshed.**
1919

20-
Typeshed supports Python versions 2.7 and 3.6 and up.
20+
Typeshed supports Python versions 2.7 and 3.7 and up.
2121

2222
## Using
2323

tests/mypy_test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
import tomli
2929
from colors import colored, print_error, print_success_msg
3030

31-
SUPPORTED_VERSIONS = [(3, 11), (3, 10), (3, 9), (3, 8), (3, 7), (3, 6), (2, 7)]
31+
SUPPORTED_VERSIONS = [(3, 11), (3, 10), (3, 9), (3, 8), (3, 7), (2, 7)]
3232
SUPPORTED_PLATFORMS = frozenset({"linux", "win32", "darwin"})
3333
TYPESHED_DIRECTORIES = frozenset({"stdlib", "stubs", "tests", "test_cases", "scripts"})
3434

tests/stubtest_allowlists/darwin-py310.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
_?curses.A_ITALIC
21
_?curses.color_pair
32
webbrowser.MacOSXOSAScript.__init__
43
distutils.util.__warningregistry__

tests/stubtest_allowlists/darwin-py311.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
_?curses.A_ITALIC
21
_?curses.color_pair
32
xxlimited.Xxo.x_exports
43
distutils.util.__warningregistry__

tests/stubtest_allowlists/darwin-py36.txt

-20
This file was deleted.

tests/stubtest_allowlists/darwin-py37.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
_?curses.A_ITALIC
21
ctypes.wintypes
32
pwd.getpwnam
43
webbrowser.MacOSXOSAScript.__init__

tests/stubtest_allowlists/darwin-py38.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
_?curses.A_ITALIC
21
webbrowser.MacOSXOSAScript.__init__
32

43
# ==========

tests/stubtest_allowlists/darwin-py39.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
_?curses.A_ITALIC
21
webbrowser.MacOSXOSAScript.__init__
32

43
# ==========

tests/stubtest_allowlists/darwin.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
_?curses.A_ITALIC
2+
13
_posixsubprocess.cloexec_pipe
24
os.EX_NOTFOUND
35
os.SF_MNOWAIT

tests/stubtest_allowlists/linux-py36.txt

-17
This file was deleted.

tests/stubtest_allowlists/py310.txt

-22
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,14 @@ _collections_abc.ValuesView.__reversed__
99
_weakref.ProxyType.__reversed__ # Doesn't really exist
1010
asyncio.Future.__init__ # Usually initialized from c object
1111
asyncio.futures.Future.__init__ # Usually initialized from c object
12-
builtins.dict.get
1312
builtins.float.__setformat__ # Internal method for CPython test suite
1413
builtins.property.__set_name__ # Doesn't actually exist
1514
contextlib.AbstractAsyncContextManager.__class_getitem__
1615
contextlib.AbstractContextManager.__class_getitem__
17-
enum.Enum._generate_next_value_
1816
fractions.Fraction.__new__ # overload is too complicated for stubtest to resolve
1917
gettext.install
2018
gettext.translation
2119
hmac.new # Stub is a white lie; see comments in the stub
22-
http.server.SimpleHTTPRequestHandler.__init__ # *args is expanded
2320
ipaddress.IPv4Interface.hostmask
2421
ipaddress.IPv6Interface.hostmask
2522
ipaddress._BaseNetwork.broadcast_address
@@ -31,15 +28,13 @@ platform.uname_result.__match_args__
3128
platform.uname_result.__new__
3229
platform.uname_result._fields
3330
platform.uname_result.processor
34-
re.Pattern.scanner # Undocumented and not useful. #6405
3531
sys.UnraisableHookArgs # Not exported from sys
3632
tkinter.Tk.split
3733
types.GenericAlias.__getattr__
3834
types.GenericAlias.__mro_entries__
3935
types.GenericAlias.__call__ # Would be complicated to fix properly, Any could silence problems. #6392
4036
typing._SpecialForm.__mro_entries__
4137
typing.ForwardRef._evaluate
42-
typing._SpecialForm.__init__
4338
typing._TypedDict.__delitem__
4439
typing._TypedDict.__ior__
4540
typing._TypedDict.__or__
@@ -76,9 +71,6 @@ _csv.Reader
7671
_csv.Writer
7772
asynchat.__warningregistry__ # Removal planned for 3.12, can add if someone needs this
7873
bdb.Breakpoint.clearBreakpoints
79-
distutils.dist.DistributionMetadata.set_classifiers
80-
distutils.dist.DistributionMetadata.set_keywords
81-
distutils.dist.DistributionMetadata.set_platforms
8274
distutils.util.get_host_platform
8375
functools.partial.__vectorcalloffset__ # undocumented implementation detail
8476
inspect.Signature.from_builtin # Removed in 3.11, can add if someone needs this
@@ -89,7 +81,6 @@ multiprocessing.managers.SharedMemoryServer.public
8981
multiprocessing.managers.SharedMemoryServer.release_segment
9082
multiprocessing.managers.SharedMemoryServer.shutdown
9183
multiprocessing.managers.SharedMemoryServer.track_segment
92-
typing._SpecialForm.__call__
9384

9485
# ==========
9586
# Related to positional-only arguments
@@ -152,7 +143,6 @@ ast.Index.__new__
152143
ast.NameConstant.__new__
153144
ast.Num.__new__
154145
ast.Str.__new__
155-
contextvars.Context.__init__
156146
queue.SimpleQueue.__init__
157147
xml.etree.ElementTree.XMLParser.__init__
158148
xml.etree.cElementTree.XMLParser.__init__
@@ -172,21 +162,9 @@ typing.SupportsRound.__init__
172162

173163
ftplib.FTP.trust_server_pasv_ipv4_address # Dangerous to use, intentionally undocumented, intentionally missing from typeshed. #6154
174164
os.PathLike.__class_getitem__ # PathLike is a protocol; we don't expect all PathLike classes to implement class_getitem
175-
ssl.PROTOCOL_SSLv3 # Depends on ssl compilation
176-
ssl.RAND_egd # Depends on openssl compilation
177165
types.CodeType.replace # stubtest thinks default values are None but None doesn't work at runtime
178166
_ast.ImportFrom.level # None on the class, but never None on instances
179167
ast.ImportFrom.level # None on the class, but never None on instances
180168

181-
# These enums derive from (str, Enum). See comment in py3_common.txt
182-
pstats.SortKey.__new__
183-
tkinter.EventType.__new__
184-
185169
# White lies around defaults
186-
dataclasses.field
187170
dataclasses.KW_ONLY
188-
189-
# Runtime signature is incorrect (https://github.com/python/cpython/issues/93021)
190-
types.ClassMethodDescriptorType.__get__
191-
types.MethodDescriptorType.__get__
192-
types.WrapperDescriptorType.__get__

tests/stubtest_allowlists/py311.txt

-22
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,9 @@ _operator.attrgetter.__vectorcalloffset__
1616
_operator.itemgetter.__vectorcalloffset__
1717
argparse._MutuallyExclusiveGroup.add_mutually_exclusive_group
1818
asynchat.__warningregistry__ # Removal planned for 3.12, can add if someone needs this
19-
builtins.dict.get
2019
configparser.LegacyInterpolation.__init__
21-
contextvars.Context.__init__
22-
distutils.dist.DistributionMetadata.set_classifiers
23-
distutils.dist.DistributionMetadata.set_keywords
24-
distutils.dist.DistributionMetadata.set_platforms
2520
distutils.util.get_host_platform
2621
enum.Enum.__init__
27-
enum.Enum._generate_next_value_
2822
fractions.Fraction.__new__ # overload is too complicated for stubtest to resolve
2923
ftplib.FTP.trust_server_pasv_ipv4_address
3024
functools.partial.__vectorcalloffset__
@@ -107,9 +101,7 @@ builtins.property.__set_name__ # Doesn't actually exist
107101
enum.StrEnum.value # read-only property at runtime but too magical for stubtest
108102
hmac.new # Stub is a white lie; see comments in the stub
109103
http.HTTPMethod.description # mutable instance attribute at runtime but we pretend it's a property
110-
http.server.SimpleHTTPRequestHandler.__init__ # *args is expanded
111104
pickle.Pickler.reducer_override # implemented in C pickler
112-
re.Pattern.scanner # Undocumented and not useful. #6405
113105
types.GenericAlias.__call__ # Would be complicated to fix properly, Any could silence problems. #6392
114106
types.GenericAlias.__getattr__
115107
types.GenericAlias.__mro_entries__
@@ -152,24 +144,16 @@ xml.etree.ElementTree.XMLParser.__init__
152144
xml.etree.cElementTree.XMLParser.__init__
153145

154146
os.PathLike.__class_getitem__ # PathLike is a protocol; we don't expect all PathLike classes to implement class_getitem
155-
ssl.PROTOCOL_SSLv3 # Depends on ssl compilation
156-
ssl.RAND_egd # Depends on openssl compilation
157147
types.CodeType.replace # stubtest thinks default values are None but None doesn't work at runtime
158148
_ast.ImportFrom.level # None on the class, but never None on instances
159149
ast.ImportFrom.level # None on the class, but never None on instances
160150

161-
# These enums derive from (str, Enum). See comment in py3_common.txt
162-
pstats.SortKey.__new__
163-
tkinter.EventType.__new__
164-
165151
# Treated an alias of a typing class in the stubs,
166152
# they are generic to type checkers anyway.
167153
contextlib.AbstractAsyncContextManager.__class_getitem__
168154
contextlib.AbstractContextManager.__class_getitem__
169155

170156
# Super-special typing primitives
171-
typing._SpecialForm.__call__
172-
typing._SpecialForm.__init__
173157
typing._SpecialForm.__mro_entries__
174158
typing._TypedDict.__delitem__
175159
typing._TypedDict.__ior__
@@ -184,7 +168,6 @@ typing._TypedDict.values
184168

185169
# White lies around defaults
186170
dataclasses.KW_ONLY
187-
dataclasses.field
188171

189172
# https://github.com/python/mypy/issues/12819 (... in runtime default)
190173
wsgiref.types.InputStream.read
@@ -198,8 +181,3 @@ wsgiref.types.WSGIApplication
198181

199182
# Really it's mad about dict.get
200183
wsgiref.types.WSGIEnvironment.get
201-
202-
# Runtime signature is incorrect (https://github.com/python/cpython/issues/93021)
203-
types.ClassMethodDescriptorType.__get__
204-
types.MethodDescriptorType.__get__
205-
types.WrapperDescriptorType.__get__

0 commit comments

Comments
 (0)