Skip to content

Commit

Permalink
Switch to using pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
srittau committed Oct 13, 2024
1 parent 95e429e commit 0506e89
Show file tree
Hide file tree
Showing 15 changed files with 22 additions and 50 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ __pycache__/
# Distribution / packaging
.Python
/env/
/build/
/lib/build/
/develop-eggs/
/dist/
/downloads/
Expand Down
1 change: 1 addition & 0 deletions lib/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Utilities for typeshed infrastructure scripts.
2 changes: 1 addition & 1 deletion lib/ts_utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"""Utility functions for typeshed infrastructure scripts."""
"""Utilities for typeshed infrastructure scripts."""
3 changes: 3 additions & 0 deletions requirements-tests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ tomli==2.0.2
tomlkit==0.13.2
typing_extensions>=4.12.0rc1
uv==0.4.18

# Utilities for typeshed infrastructure scripts.
ts_utils @ file:lib
7 changes: 2 additions & 5 deletions tests/check_typeshed_structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,8 @@
import sys
from pathlib import Path

sys.path += ["lib"]


from ts_utils.metadata import read_metadata # noqa: E402
from ts_utils.utils import ( # noqa: E402
from ts_utils.metadata import read_metadata
from ts_utils.utils import (
REQS_FILE,
STDLIB_PATH,
TEST_CASES_DIR,
Expand Down
5 changes: 1 addition & 4 deletions tests/get_external_stub_requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@

from packaging.requirements import Requirement

sys.path += ["lib"]


from ts_utils.metadata import read_dependencies # noqa: E402
from ts_utils.metadata import read_dependencies

distributions = sys.argv[1:]
if not distributions:
Expand Down
5 changes: 1 addition & 4 deletions tests/get_stubtest_system_requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
import os
import sys

sys.path += ["lib"]


from ts_utils.metadata import read_stubtest_settings # noqa: E402
from ts_utils.metadata import read_stubtest_settings

platform = sys.platform
distributions = sys.argv[1:]
Expand Down
7 changes: 2 additions & 5 deletions tests/mypy_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,8 @@
import tomli
from packaging.requirements import Requirement

sys.path += ["lib"]


from ts_utils.metadata import PackageDependencies, get_recursive_requirements, read_metadata # noqa: E402
from ts_utils.utils import ( # noqa: E402
from ts_utils.metadata import PackageDependencies, get_recursive_requirements, read_metadata
from ts_utils.utils import (
PYTHON_VERSION,
STDLIB_PATH,
TESTS_DIR,
Expand Down
5 changes: 1 addition & 4 deletions tests/pyright_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
import sys
from pathlib import Path

sys.path += ["lib"]


from ts_utils.utils import parse_requirements, print_command # noqa: E402
from ts_utils.utils import parse_requirements, print_command

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

Expand Down
7 changes: 2 additions & 5 deletions tests/pytype_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,8 @@
from pytype import config as pytype_config, load_pytd # type: ignore[import]
from pytype.imports import typeshed # type: ignore[import]

sys.path += ["lib"]


from ts_utils.metadata import read_dependencies # noqa: E402
from ts_utils.utils import SupportedVersionsDict, parse_stdlib_versions_file, supported_versions_for_module # noqa: E402
from ts_utils.metadata import read_dependencies
from ts_utils.utils import SupportedVersionsDict, parse_stdlib_versions_file, supported_versions_for_module

TYPESHED_SUBDIRS = ["stdlib", "stubs"]
TYPESHED_HOME = "TYPESHED_HOME"
Expand Down
7 changes: 2 additions & 5 deletions tests/regr_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,8 @@
from pathlib import Path
from typing_extensions import TypeAlias

sys.path += ["lib"]


from ts_utils.metadata import get_recursive_requirements, read_metadata # noqa: E402
from ts_utils.utils import ( # noqa: E402
from ts_utils.metadata import get_recursive_requirements, read_metadata
from ts_utils.utils import (
PYTHON_VERSION,
TEST_CASES_DIR,
DistributionTests,
Expand Down
5 changes: 1 addition & 4 deletions tests/runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@
from importlib.util import find_spec
from pathlib import Path

sys.path += ["lib"]


from ts_utils.utils import TEST_CASES_DIR, colored, test_cases_path # noqa: E402
from ts_utils.utils import TEST_CASES_DIR, colored, test_cases_path

_STRICTER_CONFIG_FILE = "pyrightconfig.stricter.json"
_TESTCASES_CONFIG_FILE = "pyrightconfig.testcases.json"
Expand Down
4 changes: 1 addition & 3 deletions tests/stubtest_stdlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@
import sys
from pathlib import Path

sys.path += ["lib"]

from ts_utils.utils import allowlist_stubtest_arguments, allowlists_path # noqa: E402
from ts_utils.utils import allowlist_stubtest_arguments, allowlists_path


def run_stubtest(typeshed_dir: Path) -> int:
Expand Down
7 changes: 2 additions & 5 deletions tests/stubtest_third_party.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,8 @@
from textwrap import dedent
from typing import NoReturn

sys.path += ["lib"]


from ts_utils.metadata import NoSuchStubError, get_recursive_requirements, read_metadata # noqa: E402
from ts_utils.utils import ( # noqa: E402
from ts_utils.metadata import NoSuchStubError, get_recursive_requirements, read_metadata
from ts_utils.utils import (
PYTHON_VERSION,
allowlist_stubtest_arguments,
allowlists_path,
Expand Down
5 changes: 1 addition & 4 deletions tests/typecheck_typeshed.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@
from itertools import product
from typing_extensions import TypeAlias

sys.path += ["lib"]


from ts_utils.utils import colored, print_error # noqa: E402
from ts_utils.utils import colored, print_error

ReturnCode: TypeAlias = int

Expand Down

0 comments on commit 0506e89

Please sign in to comment.