mirror of
https://github.com/astral-sh/ruff.git
synced 2025-07-28 23:43:53 +00:00
Remove some hardcoded modules from generate_known_standard_library.py
(#11409)
See feedback in: https://github.com/astral-sh/ruff/pull/11374
This commit is contained in:
parent
c3c87e86ef
commit
dc5c44ccc4
2 changed files with 2 additions and 11 deletions
|
@ -245,7 +245,6 @@ pub fn is_known_standard_library(minor_version: u8, module: &str) -> bool {
|
||||||
| "socketserver"
|
| "socketserver"
|
||||||
| "spwd"
|
| "spwd"
|
||||||
| "sqlite3"
|
| "sqlite3"
|
||||||
| "sre"
|
|
||||||
| "sre_compile"
|
| "sre_compile"
|
||||||
| "sre_constants"
|
| "sre_constants"
|
||||||
| "sre_parse"
|
| "sre_parse"
|
||||||
|
|
|
@ -27,18 +27,10 @@ pub fn is_known_standard_library(minor_version: u8, module: &str) -> bool {
|
||||||
modules_by_version = {}
|
modules_by_version = {}
|
||||||
|
|
||||||
for major_version, minor_version in VERSIONS:
|
for major_version, minor_version in VERSIONS:
|
||||||
modules = {
|
modules = set()
|
||||||
"_ast",
|
|
||||||
"posixpath",
|
|
||||||
"ntpath",
|
|
||||||
"sre_constants",
|
|
||||||
"sre_parse",
|
|
||||||
"sre_compile",
|
|
||||||
"sre",
|
|
||||||
}
|
|
||||||
|
|
||||||
for module in stdlib_module_names(f"{major_version}.{minor_version}"):
|
for module in stdlib_module_names(f"{major_version}.{minor_version}"):
|
||||||
if module not in ["__future__", "__main__"]:
|
if module != "__future__":
|
||||||
modules.add(module)
|
modules.add(module)
|
||||||
|
|
||||||
modules_by_version[minor_version] = modules
|
modules_by_version[minor_version] = modules
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue