Skip to content

Commit 4362932

Browse files
committed
feat(lookup_table): builtin module update for Python 3.13
1 parent bd32f3f commit 4362932

File tree

1 file changed

+184
-18
lines changed

1 file changed

+184
-18
lines changed

lua/python_import/lookup_table.lua

Lines changed: 184 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,202 @@ M = {}
33
-- If nothing is found, it will return `import ..` anyway.
44
-- However, it might take some time to search the candidate,
55
-- so we define a list of common imports here.
6+
-- Updated for Python 3.13
67
---@type string[]
78
M.default_import = {
8-
"pickle",
9-
"os",
10-
"sys",
11-
"re",
12-
"json",
13-
"time",
14-
"datetime",
15-
"random",
16-
"math",
17-
"importlib",
9+
-- built-in
10+
"abc",
1811
"argparse",
19-
"shutil",
12+
"array",
13+
"ast",
14+
"asyncio",
15+
"atexit",
16+
"base64",
17+
"bdb",
18+
"binascii",
19+
"bisect",
20+
"builtins",
21+
"bz2",
22+
23+
"calendar",
24+
"cmath",
25+
"cmd",
26+
"code",
27+
"codecs",
28+
"codeop",
29+
"collections",
30+
"colorsys",
31+
"compileall",
32+
"concurrent",
33+
"configparser",
34+
"contextlib",
35+
"contextvars",
2036
"copy",
37+
"copyreg",
38+
"cProfile",
39+
"csv",
40+
"ctypes",
41+
"curses",
2142
"dataclasses",
43+
"datetime",
44+
"dbm",
45+
"decimal",
46+
"difflib",
47+
"dis",
48+
"doctest",
49+
50+
"email",
51+
"encodings",
52+
"ensurepip",
2253
"enum",
54+
"errno",
55+
56+
"faulthandler",
57+
"fcntl",
58+
"filecmp",
59+
"fileinput",
60+
"fnmatch",
61+
"fractions",
62+
"ftplib",
2363
"functools",
64+
65+
"gc",
66+
"getopt",
67+
"getpass",
68+
"gettext",
2469
"glob",
25-
"itertools",
26-
"pathlib",
27-
"abc",
28-
"contextlib",
29-
"collections",
70+
"graphlib",
71+
"grp",
72+
"gzip",
73+
"hashlib",
74+
"heapq",
75+
"hmac",
76+
"html",
77+
"http",
78+
"idlelib",
79+
"imaplib",
80+
"importlib",
81+
"inspect",
3082
"io",
83+
"ipaddress",
84+
"itertools",
85+
"json",
86+
"keyword",
87+
"linecache",
88+
"locale",
89+
"logging",
90+
"lzma",
91+
"mailbox",
92+
"marshal",
93+
"math",
94+
"mimetypes",
95+
"mmap",
96+
"modulefinder",
97+
"msvcrt",
3198
"multiprocessing",
99+
"netrc",
100+
"numbers",
101+
"operator",
102+
"optparse",
103+
"os",
104+
"pathlib",
105+
"pdb",
106+
"pickle",
107+
"pickletools",
108+
"pkgutil",
109+
"platform",
110+
"plistlib",
111+
"poplib",
112+
"posix",
113+
"pprint",
114+
"profile",
115+
"pstats",
116+
"pty",
117+
"pwd",
118+
"py_compile",
119+
"pyclbr",
120+
"pydoc",
121+
122+
"queue",
123+
"quopri",
124+
"random",
125+
"re",
126+
"readline",
127+
"reprlib",
128+
"resource",
129+
"rlcompleter",
130+
"runpy",
131+
"sched",
132+
"secrets",
133+
"select",
134+
"selectors",
135+
"shelve",
136+
"shlex",
137+
"shutil",
138+
"signal",
139+
"site",
140+
"sitecustomize",
141+
"smtplib",
142+
"socket",
143+
"socketserver",
144+
"sqlite3",
145+
"ssl",
146+
"stat",
147+
"statistics",
148+
"string",
149+
"stringprep",
150+
"struct",
151+
"subprocess",
152+
"symtable",
153+
"sys",
154+
"sysconfig",
155+
"syslog",
156+
157+
"tabnanny",
158+
"tarfile",
159+
"tempfile",
160+
"termios",
161+
"test",
162+
"textwrap",
163+
"threading",
164+
"time",
165+
"timeit",
166+
"tkinter",
167+
"token",
168+
"tokenize",
169+
"tomllib",
170+
"trace",
171+
"traceback",
172+
"tracemalloc",
173+
"tty",
174+
"turtle",
175+
"turtledemo",
176+
"types",
32177
"typing",
178+
"unicodedata",
179+
"unittest",
180+
"urllib",
181+
"usercustomize",
182+
"uuid",
183+
"venv",
184+
"warnings",
185+
"wave",
186+
"weakref",
187+
"webbrowser",
188+
"winreg",
189+
"winsound",
190+
"wsgiref",
191+
"xml",
192+
"xmlrpc",
193+
"zipapp",
194+
"zipfile",
195+
"zipimport",
196+
"zlib",
197+
"zoneinfo",
198+
199+
-- not built-in
33200
"typing_extensions",
34201
"setuptools",
35-
"subprocess",
36-
"xml",
37202

38203
-- third-party
39204
"PIL",
@@ -42,6 +207,7 @@ M.default_import = {
42207
"selenium",
43208
"neptune",
44209
"torch",
210+
"pytest",
45211
}
46212

47213
---@type table<string, string>

0 commit comments

Comments
 (0)