fix(python): ignore stdlib imports with _

This commit is contained in:
Ruben Fiszel
2024-02-21 00:10:52 +01:00
parent 978316797d
commit 9af7684f06
@@ -214,91 +214,91 @@ pub async fn parse_python_imports(
}
const STDIMPORTS: [&str; 302] = [
"__future__",
"_abc",
"_aix_support",
"_ast",
"_asyncio",
"_bisect",
"_blake2",
"_bootsubprocess",
"_bz2",
"_codecs",
"_codecs_cn",
"_codecs_hk",
"_codecs_iso2022",
"_codecs_jp",
"_codecs_kr",
"_codecs_tw",
"_collections",
"_collections_abc",
"_compat_pickle",
"_compression",
"_contextvars",
"_crypt",
"_csv",
"_ctypes",
"_curses",
"_curses_panel",
"_datetime",
"_dbm",
"_decimal",
"_elementtree",
"_frozen_importlib",
"_frozen_importlib_external",
"_functools",
"_gdbm",
"_hashlib",
"_heapq",
"_imp",
"_io",
"_json",
"_locale",
"_lsprof",
"_lzma",
"_markupbase",
"_md5",
"_msi",
"_multibytecodec",
"_multiprocessing",
"_opcode",
"_operator",
"_osx_support",
"_overlapped",
"_pickle",
"_posixshmem",
"_posixsubprocess",
"_py_abc",
"_pydecimal",
"_pyio",
"_queue",
"_random",
"_sha1",
"_sha256",
"_sha3",
"_sha512",
"_signal",
"_sitebuiltins",
"_socket",
"_sqlite3",
"_sre",
"_ssl",
"_stat",
"_statistics",
"_string",
"_strptime",
"_struct",
"_symtable",
"_thread",
"_threading_local",
"_tkinter",
"_tracemalloc",
"_uuid",
"_warnings",
"_weakref",
"_weakrefset",
"_winapi",
"_zoneinfo",
"--future--",
"-abc",
"-aix-support",
"-ast",
"-asyncio",
"-bisect",
"-blake2",
"-bootsubprocess",
"-bz2",
"-codecs",
"-codecs-cn",
"-codecs-hk",
"-codecs-iso2022",
"-codecs-jp",
"-codecs-kr",
"-codecs-tw",
"-collections",
"-collections-abc",
"-compat-pickle",
"-compression",
"-contextvars",
"-crypt",
"-csv",
"-ctypes",
"-curses",
"-curses-panel",
"-datetime",
"-dbm",
"-decimal",
"-elementtree",
"-frozen-importlib",
"-frozen-importlib-external",
"-functools",
"-gdbm",
"-hashlib",
"-heapq",
"-imp",
"-io",
"-json",
"-locale",
"-lsprof",
"-lzma",
"-markupbase",
"-md5",
"-msi",
"-multibytecodec",
"-multiprocessing",
"-opcode",
"-operator",
"-osx-support",
"-overlapped",
"-pickle",
"-posixshmem",
"-posixsubprocess",
"-py-abc",
"-pydecimal",
"-pyio",
"-queue",
"-random",
"-sha1",
"-sha256",
"-sha3",
"-sha512",
"-signal",
"-sitebuiltins",
"-socket",
"-sqlite3",
"-sre",
"-ssl",
"-stat",
"-statistics",
"-string",
"-strptime",
"-struct",
"-symtable",
"-thread",
"-threading-local",
"-tkinter",
"-tracemalloc",
"-uuid",
"-warnings",
"-weakref",
"-weakrefset",
"-winapi",
"-zoneinfo",
"zoneinfo",
"abc",
"aifc",
@@ -430,10 +430,10 @@ const STDIMPORTS: [&str; 302] = [
"pstats",
"pty",
"pwd",
"py_compile",
"py-compile",
"pyclbr",
"pydoc",
"pydoc_data",
"pydoc-data",
"pyexpat",
"queue",
"quopri",
@@ -460,9 +460,9 @@ const STDIMPORTS: [&str; 302] = [
"socketserver",
"spwd",
"sqlite3",
"sre_compile",
"sre_constants",
"sre_parse",
"sre-compile",
"sre-constants",
"sre-parse",
"ssl",
"stat",
"statistics",