Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 425c69a

Browse files
authored
Prefix utility modules with underscore (#11999)
1 parent f9664a4 commit 425c69a

15 files changed

Lines changed: 21 additions & 19 deletions

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ extra-standard-library = [
147147
"opcode",
148148
"pyexpat",
149149
]
150-
known-first-party = ["parse_metadata", "utils"]
150+
known-first-party = ["_metadata", "_utils"]
151151

152152
[tool.typeshed]
153153
oldest_supported_python = "3.8"

scripts/stubsabot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ async def get_github_repo_info(session: aiohttp.ClientSession, stub_info: StubIn
305305
Else, return None.
306306
"""
307307
if stub_info.upstream_repository:
308-
# We have various sanity checks for the upstream_repository field in tests/parse_metadata.py,
308+
# We have various sanity checks for the upstream_repository field in tests/_metadata.py,
309309
# so no need to repeat all of them here
310310
split_url = urllib.parse.urlsplit(stub_info.upstream_repository)
311311
if split_url.netloc == "github.com":
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# pyright: reportUnknownVariableType=false, reportUnknownArgumentType=false
33

44
"""Tools to help parse and validate information stored in METADATA.toml files."""
5+
56
from __future__ import annotations
67

78
import os
@@ -18,7 +19,7 @@
1819
from packaging.specifiers import Specifier
1920
from packaging.version import Version
2021

21-
from utils import cache
22+
from _utils import cache
2223

2324
__all__ = [
2425
"NoSuchStubError",
File renamed without changes.

tests/check_typeshed_structure.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
import sys
1313
from pathlib import Path
1414

15-
from parse_metadata import read_metadata
16-
from utils import (
15+
from _metadata import read_metadata
16+
from _utils import (
1717
REQS_FILE,
1818
STDLIB_PATH,
1919
TEST_CASES_DIR,

tests/get_external_stub_requirements.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import os
55
import sys
66

7-
from parse_metadata import read_dependencies
7+
from _metadata import read_dependencies
88

99
distributions = sys.argv[1:]
1010
if not distributions:

tests/get_stubtest_system_requirements.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import os
33
import sys
44

5-
from parse_metadata import read_stubtest_settings
5+
from _metadata import read_stubtest_settings
66

77
platform = sys.platform
88
distributions = sys.argv[1:]

tests/mypy_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626

2727
import tomli
2828

29-
from parse_metadata import PackageDependencies, get_recursive_requirements, read_metadata
30-
from utils import (
29+
from _metadata import PackageDependencies, get_recursive_requirements, read_metadata
30+
from _utils import (
3131
PYTHON_VERSION,
3232
TESTS_DIR,
3333
VERSIONS_RE as VERSION_LINE_RE,
@@ -202,7 +202,7 @@ def add_configuration(configurations: list[MypyDistConf], distribution: str) ->
202202
with Path("stubs", distribution, "METADATA.toml").open("rb") as f:
203203
data = tomli.load(f)
204204

205-
# TODO: This could be added to parse_metadata.py, but is currently unused
205+
# TODO: This could be added to _metadata.py, but is currently unused
206206
mypy_tests_conf: dict[str, dict[str, Any]] = data.get("mypy-tests", {})
207207
if not mypy_tests_conf:
208208
return

tests/pyright_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import sys
77
from pathlib import Path
88

9-
from utils import parse_requirements, print_command
9+
from _utils import parse_requirements, print_command
1010

1111
_WELL_KNOWN_FILE = Path("tests", "pyright_test.py")
1212

tests/pytype_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
from packaging.requirements import Requirement
2626

27-
from parse_metadata import read_dependencies
27+
from _metadata import read_dependencies
2828

2929
if sys.platform == "win32":
3030
print("pytype does not support Windows.", file=sys.stderr)

0 commit comments

Comments
 (0)