Skip to content

Commit ed81c57

Browse files
authored
Merge branch 'main' into renovate/pytype-and-pyright
2 parents 74eca2d + 4757bf6 commit ed81c57

22 files changed

Lines changed: 65 additions & 36 deletions

MAINTAINERS.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,13 @@ blocker is, usually with a link to an open issue in another project.
7777
We want to maintain a welcoming atmosphere for contributors, so use a friendly
7878
message when closing the PR. Example message:
7979

80-
Thanks for contributing! I'm closing this PR for now, because it still
81-
<fails some tests OR has unresolved review feedback OR has a merge conflict>
82-
after three months of inactivity. If you are still interested, please feel free to open
83-
a new PR (or ping us to reopen this one).
80+
Thanks for contributing! I'm closing this PR for now, because it still <fails some tests OR has unresolved review feedback OR has a merge conflict> after three months of inactivity. If you are still interested, please feel free to open a new PR (or ping us to reopen this one).
81+
82+
### Closing PRs for future standard library changes
83+
84+
*See also the [guidelines in the CONTRIBUTING file](./CONTRIBUTING.md#standard-library-stubs).*
85+
86+
When rejecting a PR for a change for a future Python version, use a message
87+
like:
88+
89+
Thanks for contributing! Unfortunately, [as outlined in our CONTRIBUTING document](https://github.com/python/typeshed/blob/main/CONTRIBUTING.md#standard-library-stubs) we only accept pull requests to the standard library for future Python versions after the first beta version has been released. This is in part to prevent churn in the stubs, and in part because the testing infrastructure for the future version is not yet in place. Please feel free to open a new PR when the first beta version has been released. Alternatively, if this PR is still relevant, you can leave a comment here to reopen it.

pyrightconfig.stricter.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
"stubs/cffi",
3535
"stubs/click-default-group",
3636
"stubs/click-web",
37-
"stubs/commonmark",
3837
"stubs/corus",
3938
"stubs/dateparser",
4039
"stubs/defusedxml",

scripts/create_baseline_stubs.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ def get_installed_package_info(project: str) -> tuple[str, str] | None:
4646
4747
Return (normalized project name, installed version) if successful.
4848
"""
49+
# Not using "uv pip freeze" because if this is run from a global Python,
50+
# it'll mistakenly list the .venv's packages.
4951
r = subprocess.run(["pip", "freeze"], capture_output=True, text=True, check=True)
5052
return search_pip_freeze_output(project, r.stdout)
5153

@@ -220,7 +222,7 @@ def main() -> None:
220222
if info is None:
221223
print(f'Error: "{project}" is not installed', file=sys.stderr)
222224
print(file=sys.stderr)
223-
print(f'Suggestion: Run "python3 -m pip install {project}" and try again', file=sys.stderr)
225+
print(f"Suggestion: Run `{sys.executable} -m pip install {project}` and try again", file=sys.stderr)
224226
sys.exit(1)
225227
project, version = info
226228

scripts/install_all_third_party_dependencies.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33

44
from ts_utils.requirements import get_external_stub_requirements
55

6-
use_uv = "--uv" in sys.argv
7-
if use_uv:
8-
pip_command = ["uv", "pip", "install"]
9-
else:
10-
pip_command = ["pip", "install"]
11-
12-
requirements = get_external_stub_requirements()
13-
subprocess.check_call(pip_command + [str(requirement) for requirement in requirements])
6+
7+
def main() -> None:
8+
requirements = get_external_stub_requirements()
9+
# By forwarding arguments, we naturally allow non-venv (system installs)
10+
# by letting the script's user follow uv's own helpful hint of passing the `--system` flag.
11+
subprocess.check_call(["uv", "pip", "install", *sys.argv[1:], *[str(requirement) for requirement in requirements]])
12+
13+
14+
if __name__ == "__main__":
15+
main()

stubs/JACK-Client/METADATA.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ requires = ["numpy>=1.20", "types-cffi"]
55

66
[tool.stubtest]
77
# darwin and win32 are equivalent
8-
platforms = ["linux"]
8+
platforms = ["darwin", "linux"]
99
apt_dependencies = ["libjack-dev"]
10-
# brew_dependencies = ["jack"]
10+
brew_dependencies = ["jack"]
1111
# No need to install on the CI. Leaving here as information for Windows contributors.
1212
# choco_dependencies = ["jack"]
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Testing modules are not included in type stubs
2+
commonmark.tests.*

stubs/commonmark/METADATA.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,2 @@
11
version = "0.9.*"
22
upstream_repository = "https://github.com/rtfd/commonmark.py"
3-
partial_stub = true
4-
5-
[tool.stubtest]
6-
ignore_missing_stub = true
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
def _unescape(s: str) -> str: ...
2+
3+
__all__ = ["_unescape"]

stubs/commonmark/commonmark/inlines.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@ class InlineParser:
5050
def removeDelimiter(self, delim: dict[str, Any]) -> None: ...
5151
@staticmethod
5252
def removeDelimitersBetween(bottom: dict[str, Any], top: dict[str, Any]) -> None: ...
53-
def processEmphasis(self, stack_bottom) -> None: ...
53+
def processEmphasis(self, stack_bottom: dict[str, Any]) -> None: ...
5454
def parseLinkTitle(self) -> str | None: ...
5555
def parseLinkDestination(self) -> str | None: ...
5656
def parseLinkLabel(self) -> int: ...
5757
def parseOpenBracket(self, block: Node) -> Literal[True]: ...
5858
def parseBang(self, block: Node) -> Literal[True]: ...
5959
def parseCloseBracket(self, block: Node) -> Literal[True]: ...
60-
def addBracket(self, node, index, image) -> None: ...
60+
def addBracket(self, node: Node, index: int, image: bool | None) -> None: ...
6161
def removeBracket(self) -> None: ...
6262
def parseEntity(self, block: Node) -> bool: ...
6363
def parseString(self, block: Node) -> bool: ...
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
def normalize_reference(string: str) -> str: ...
2+
3+
__all__ = ["normalize_reference"]

0 commit comments

Comments
 (0)