|
23 | 23 | import subprocess |
24 | 24 | import tempfile |
25 | 25 | from textwrap import dedent |
26 | | -from typing import Dict, List, Optional |
| 26 | +from typing import Optional |
27 | 27 |
|
28 | | -from stub_uploader.const import * |
| 28 | +from stub_uploader.const import ( |
| 29 | + CHANGELOG_PATH, |
| 30 | + META, |
| 31 | + TESTS_NAMESPACE, |
| 32 | + THIRD_PARTY_NAMESPACE, |
| 33 | +) |
29 | 34 | from stub_uploader.metadata import Metadata, read_metadata |
30 | 35 |
|
31 | 36 | CHANGELOG = "CHANGELOG.md" |
@@ -99,7 +104,7 @@ def __init__(self, typeshed_dir: str, distribution: str) -> None: |
99 | 104 | self.stub_dir = os.path.join(typeshed_dir, THIRD_PARTY_NAMESPACE, distribution) |
100 | 105 |
|
101 | 106 |
|
102 | | -def find_stub_files(top: str) -> List[str]: |
| 107 | +def find_stub_files(top: str) -> list[str]: |
103 | 108 | """Find all stub files for a given package, relative to package root. |
104 | 109 |
|
105 | 110 | Raise if we find any unknown file extensions during collection. |
@@ -169,7 +174,7 @@ def copy_changelog(distribution: str, dst: str) -> None: |
169 | 174 | pass # Ignore missing changelogs |
170 | 175 |
|
171 | 176 |
|
172 | | -def collect_setup_entries(base_dir: str) -> Dict[str, List[str]]: |
| 177 | +def collect_setup_entries(base_dir: str) -> dict[str, list[str]]: |
173 | 178 | """Generate package data for a setuptools.setup() call. |
174 | 179 |
|
175 | 180 | This reflects the transformations done during copying in copy_stubs(). |
@@ -263,7 +268,7 @@ def main( |
263 | 268 | commit = subprocess.run( |
264 | 269 | ["git", "rev-parse", "HEAD"], |
265 | 270 | capture_output=True, |
266 | | - universal_newlines=True, |
| 271 | + text=True, |
267 | 272 | cwd=typeshed_dir, |
268 | 273 | ).stdout.strip() |
269 | 274 | metadata = read_metadata(typeshed_dir, distribution) |
|
0 commit comments