Skip to content

Commit 4ccbd1e

Browse files
authoredSep 13, 2021
Merge pull request #1809 from mkniewallner/issue/1808
Issue #1808: Add support for Python 3.10
2 parents bf9398e + e10dbfa commit 4ccbd1e

File tree

11 files changed

+261
-56
lines changed

11 files changed

+261
-56
lines changed
 

‎.github/workflows/integration.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
runs-on: ubuntu-latest
88
strategy:
99
matrix:
10-
python-version: [3.8]
10+
python-version: ["3.8"]
1111

1212
steps:
1313
- uses: actions/checkout@v2

‎.github/workflows/lint.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
runs-on: ubuntu-latest
88
strategy:
99
matrix:
10-
python-version: [3.8]
10+
python-version: ["3.8"]
1111

1212
steps:
1313
- uses: actions/checkout@v2

‎.github/workflows/test.yml

+10-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
strategy:
99
fail-fast: false
1010
matrix:
11-
python-version: [3.6, 3.7, 3.8]
11+
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10.0-rc.2"]
1212
os: [ubuntu-latest, ubuntu-18.04, macos-latest, windows-latest]
1313

1414
steps:
@@ -48,11 +48,18 @@ jobs:
4848
with:
4949
python-version: ${{ matrix.python-version }}
5050

51-
- name: Install dependencies
51+
- name: Install poetry
5252
run: |
5353
python -m pip install --upgrade pip
5454
python -m pip install --upgrade poetry
55-
poetry install
55+
56+
# New poetry installer doesn't work well with Python 3.10 (see https://github.com/python-poetry/poetry/issues/4210).
57+
- name: Use legacy poetry installer
58+
if: startsWith(matrix.python-version, '3.10')
59+
run: poetry config experimental.new-installer false
60+
61+
- name: Install dependencies
62+
run: poetry install
5663

5764
- name: Test
5865
shell: bash

‎CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Find out more about isort's release policy [here](https://pycqa.github.io/isort/
88
- Implemented #1796: Switch to `tomli` for pyproject.toml configuration loader.
99
- Fixed #1801: CLI bug (--exend-skip-glob, overrides instead of extending).
1010
- Fixed #1802: respect PATH customization in nested calls to git.
11+
- Added support for Python 3.10
1112

1213
#### Potentially breaking changes:
1314
- Fixed #1785: `_ast` module incorrectly excluded from stdlib definition.

‎isort/settings.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ def __post_init__(self) -> None:
245245
if sys.version_info.major == 2 and sys.version_info.minor <= 6:
246246
py_version = "2"
247247
elif sys.version_info.major == 3 and (
248-
sys.version_info.minor <= 5 or sys.version_info.minor >= 9
248+
sys.version_info.minor <= 5 or sys.version_info.minor >= 10
249249
):
250250
py_version = "3"
251251
else:

‎isort/stdlibs/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
from . import all as _all
2-
from . import py2, py3, py27, py35, py36, py37, py38, py39
2+
from . import py2, py3, py27, py35, py36, py37, py38, py39, py310

‎isort/stdlibs/py3.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
from . import py35, py36, py37, py38, py39
1+
from . import py35, py36, py37, py38, py39, py310
22

3-
stdlib = py35.stdlib | py36.stdlib | py37.stdlib | py38.stdlib | py39.stdlib
3+
stdlib = py35.stdlib | py36.stdlib | py37.stdlib | py38.stdlib | py39.stdlib | py310.stdlib

‎isort/stdlibs/py310.py

+221
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,221 @@
1+
"""
2+
File contains the standard library of Python 3.10.
3+
4+
DO NOT EDIT. If the standard library changes, a new list should be created
5+
using the mkstdlibs.py script.
6+
"""
7+
8+
stdlib = {
9+
"_ast",
10+
"_thread",
11+
"abc",
12+
"aifc",
13+
"argparse",
14+
"array",
15+
"ast",
16+
"asynchat",
17+
"asyncio",
18+
"asyncore",
19+
"atexit",
20+
"audioop",
21+
"base64",
22+
"bdb",
23+
"binascii",
24+
"binhex",
25+
"bisect",
26+
"builtins",
27+
"bz2",
28+
"cProfile",
29+
"calendar",
30+
"cgi",
31+
"cgitb",
32+
"chunk",
33+
"cmath",
34+
"cmd",
35+
"code",
36+
"codecs",
37+
"codeop",
38+
"collections",
39+
"colorsys",
40+
"compileall",
41+
"concurrent",
42+
"configparser",
43+
"contextlib",
44+
"contextvars",
45+
"copy",
46+
"copyreg",
47+
"crypt",
48+
"csv",
49+
"ctypes",
50+
"curses",
51+
"dataclasses",
52+
"datetime",
53+
"dbm",
54+
"decimal",
55+
"difflib",
56+
"dis",
57+
"distutils",
58+
"doctest",
59+
"email",
60+
"encodings",
61+
"ensurepip",
62+
"enum",
63+
"errno",
64+
"faulthandler",
65+
"fcntl",
66+
"filecmp",
67+
"fileinput",
68+
"fnmatch",
69+
"fractions",
70+
"ftplib",
71+
"functools",
72+
"gc",
73+
"getopt",
74+
"getpass",
75+
"gettext",
76+
"glob",
77+
"graphlib",
78+
"grp",
79+
"gzip",
80+
"hashlib",
81+
"heapq",
82+
"hmac",
83+
"html",
84+
"http",
85+
"imaplib",
86+
"imghdr",
87+
"imp",
88+
"importlib",
89+
"inspect",
90+
"io",
91+
"ipaddress",
92+
"itertools",
93+
"json",
94+
"keyword",
95+
"lib2to3",
96+
"linecache",
97+
"locale",
98+
"logging",
99+
"lzma",
100+
"mailbox",
101+
"mailcap",
102+
"marshal",
103+
"math",
104+
"mimetypes",
105+
"mmap",
106+
"modulefinder",
107+
"msilib",
108+
"msvcrt",
109+
"multiprocessing",
110+
"netrc",
111+
"nis",
112+
"nntplib",
113+
"ntpath",
114+
"numbers",
115+
"operator",
116+
"optparse",
117+
"os",
118+
"ossaudiodev",
119+
"pathlib",
120+
"pdb",
121+
"pickle",
122+
"pickletools",
123+
"pipes",
124+
"pkgutil",
125+
"platform",
126+
"plistlib",
127+
"poplib",
128+
"posix",
129+
"posixpath",
130+
"pprint",
131+
"profile",
132+
"pstats",
133+
"pty",
134+
"pwd",
135+
"py_compile",
136+
"pyclbr",
137+
"pydoc",
138+
"queue",
139+
"quopri",
140+
"random",
141+
"re",
142+
"readline",
143+
"reprlib",
144+
"resource",
145+
"rlcompleter",
146+
"runpy",
147+
"sched",
148+
"secrets",
149+
"select",
150+
"selectors",
151+
"shelve",
152+
"shlex",
153+
"shutil",
154+
"signal",
155+
"site",
156+
"smtpd",
157+
"smtplib",
158+
"sndhdr",
159+
"socket",
160+
"socketserver",
161+
"spwd",
162+
"sqlite3",
163+
"sre",
164+
"sre_compile",
165+
"sre_constants",
166+
"sre_parse",
167+
"ssl",
168+
"stat",
169+
"statistics",
170+
"string",
171+
"stringprep",
172+
"struct",
173+
"subprocess",
174+
"sunau",
175+
"symtable",
176+
"sys",
177+
"sysconfig",
178+
"syslog",
179+
"tabnanny",
180+
"tarfile",
181+
"telnetlib",
182+
"tempfile",
183+
"termios",
184+
"test",
185+
"textwrap",
186+
"threading",
187+
"time",
188+
"timeit",
189+
"tkinter",
190+
"token",
191+
"tokenize",
192+
"trace",
193+
"traceback",
194+
"tracemalloc",
195+
"tty",
196+
"turtle",
197+
"turtledemo",
198+
"types",
199+
"typing",
200+
"unicodedata",
201+
"unittest",
202+
"urllib",
203+
"uu",
204+
"uuid",
205+
"venv",
206+
"warnings",
207+
"wave",
208+
"weakref",
209+
"webbrowser",
210+
"winreg",
211+
"winsound",
212+
"wsgiref",
213+
"xdrlib",
214+
"xml",
215+
"xmlrpc",
216+
"zipapp",
217+
"zipfile",
218+
"zipimport",
219+
"zlib",
220+
"zoneinfo",
221+
}

‎poetry.lock

+21-45
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ classifiers = [
2424
"Programming Language :: Python :: 3.7",
2525
"Programming Language :: Python :: 3.8",
2626
"Programming Language :: Python :: 3.9",
27+
"Programming Language :: Python :: 3.10",
2728
"Programming Language :: Python :: 3 :: Only",
2829
"Programming Language :: Python :: Implementation :: CPython",
2930
"Programming Language :: Python :: Implementation :: PyPy",
@@ -75,7 +76,6 @@ pipfile = "^0.0.2"
7576
requirementslib = "^1.5"
7677
pipreqs = "^0.4.9"
7778
pip_api = "^0.0.12"
78-
numpy = "^1.16.0"
7979
pylama = "^7.7"
8080
pip = "^21.1.1"
8181
pip-shims = "^0.5.2"

‎scripts/mkstdlibs.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
URL = "https://docs.python.org/{}/objects.inv"
66
PATH = "isort/stdlibs/py{}.py"
7-
VERSIONS = [("2", "7"), ("3", "5"), ("3", "6"), ("3", "7"), ("3", "8"), ("3", "9")]
7+
VERSIONS = [("2", "7"), ("3", "5"), ("3", "6"), ("3", "7"), ("3", "8"), ("3", "9"), ("3", "10")]
88

99
DOCSTRING = """
1010
File contains the standard library of Python {}.

0 commit comments

Comments
 (0)
Please sign in to comment.