From 4362932ebb49a5e8817b4dc2eaf9f4a1f1a47066 Mon Sep 17 00:00:00 2001 From: Kiyoon Kim Date: Fri, 27 Dec 2024 00:34:48 +0900 Subject: [PATCH] feat(lookup_table): builtin module update for Python 3.13 --- lua/python_import/lookup_table.lua | 202 ++++++++++++++++++++++++++--- 1 file changed, 184 insertions(+), 18 deletions(-) diff --git a/lua/python_import/lookup_table.lua b/lua/python_import/lookup_table.lua index ea0b349..f3122ea 100644 --- a/lua/python_import/lookup_table.lua +++ b/lua/python_import/lookup_table.lua @@ -3,37 +3,202 @@ M = {} -- If nothing is found, it will return `import ..` anyway. -- However, it might take some time to search the candidate, -- so we define a list of common imports here. +-- Updated for Python 3.13 ---@type string[] M.default_import = { - "pickle", - "os", - "sys", - "re", - "json", - "time", - "datetime", - "random", - "math", - "importlib", + -- built-in + "abc", "argparse", - "shutil", + "array", + "ast", + "asyncio", + "atexit", + "base64", + "bdb", + "binascii", + "bisect", + "builtins", + "bz2", + + "calendar", + "cmath", + "cmd", + "code", + "codecs", + "codeop", + "collections", + "colorsys", + "compileall", + "concurrent", + "configparser", + "contextlib", + "contextvars", "copy", + "copyreg", + "cProfile", + "csv", + "ctypes", + "curses", "dataclasses", + "datetime", + "dbm", + "decimal", + "difflib", + "dis", + "doctest", + + "email", + "encodings", + "ensurepip", "enum", + "errno", + + "faulthandler", + "fcntl", + "filecmp", + "fileinput", + "fnmatch", + "fractions", + "ftplib", "functools", + + "gc", + "getopt", + "getpass", + "gettext", "glob", - "itertools", - "pathlib", - "abc", - "contextlib", - "collections", + "graphlib", + "grp", + "gzip", + "hashlib", + "heapq", + "hmac", + "html", + "http", + "idlelib", + "imaplib", + "importlib", + "inspect", "io", + "ipaddress", + "itertools", + "json", + "keyword", + "linecache", + "locale", + "logging", + "lzma", + "mailbox", + "marshal", + "math", + "mimetypes", + "mmap", + "modulefinder", + "msvcrt", "multiprocessing", + "netrc", + "numbers", + "operator", + "optparse", + "os", + "pathlib", + "pdb", + "pickle", + "pickletools", + "pkgutil", + "platform", + "plistlib", + "poplib", + "posix", + "pprint", + "profile", + "pstats", + "pty", + "pwd", + "py_compile", + "pyclbr", + "pydoc", + + "queue", + "quopri", + "random", + "re", + "readline", + "reprlib", + "resource", + "rlcompleter", + "runpy", + "sched", + "secrets", + "select", + "selectors", + "shelve", + "shlex", + "shutil", + "signal", + "site", + "sitecustomize", + "smtplib", + "socket", + "socketserver", + "sqlite3", + "ssl", + "stat", + "statistics", + "string", + "stringprep", + "struct", + "subprocess", + "symtable", + "sys", + "sysconfig", + "syslog", + + "tabnanny", + "tarfile", + "tempfile", + "termios", + "test", + "textwrap", + "threading", + "time", + "timeit", + "tkinter", + "token", + "tokenize", + "tomllib", + "trace", + "traceback", + "tracemalloc", + "tty", + "turtle", + "turtledemo", + "types", "typing", + "unicodedata", + "unittest", + "urllib", + "usercustomize", + "uuid", + "venv", + "warnings", + "wave", + "weakref", + "webbrowser", + "winreg", + "winsound", + "wsgiref", + "xml", + "xmlrpc", + "zipapp", + "zipfile", + "zipimport", + "zlib", + "zoneinfo", + + -- not built-in "typing_extensions", "setuptools", - "subprocess", - "xml", -- third-party "PIL", @@ -42,6 +207,7 @@ M.default_import = { "selenium", "neptune", "torch", + "pytest", } ---@type table