Skip to content

Merge typeshed's setuptools._distutils annotations #329

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Mar 9, 2025

Conversation

Avasam
Copy link
Contributor

@Avasam Avasam commented Feb 24, 2025

Merges the annotations from: https://github.com/python/typeshed/tree/main/stubs/setuptools/setuptools/_distutils

This should allow typeshed to not have to expose and duplicate the private module to add types, instead referencing it directly in https://github.com/python/typeshed/tree/main/stubs/setuptools/distutils

It'll also improve base types for setuptools in pypa/setuptools#4689 / pypa/setuptools#4704

PathLike unions are repeated often, I could do like I did in setuptools and create runtime aliases: https://github.com/pypa/setuptools/blob/main/setuptools/_path.py

Comment on lines +39 to +42
@deprecated("format_commands is now a dict. append is deprecated.")
def append(self, item: object) -> None:
warnings.warn(
"""format_commands is now a dict. append is deprecated.""",
"format_commands is now a dict. append is deprecated.",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for introducing me to this technique. I don't love it, because it's duplicative and adds a lot of boilerplate in the import section, but if this is the best practice, let's keep it.

@jaraco jaraco merged commit 250c300 into pypa:main Mar 9, 2025
20 of 22 checks passed
@Avasam Avasam deleted the merge-typeshed-annotations branch March 9, 2025 00:49
@Avasam
Copy link
Contributor Author

Avasam commented Mar 9, 2025

Aouch, that's an ugly commit history, that one could've used a squash ^^" Oh well...

@jaraco
Copy link
Member

jaraco commented Apr 13, 2025

Aouch, that's an ugly commit history, that one could've used a squash ^^" Oh well...

😬

I tend not to squash merge except when flagged specifically (because a squash is an irreversible rewrite of history that can mask real issues). I don't mind the history, though I do sometimes squash and/or rewrite the history for a nicer story.

Honestly, I'd not worry too much about it. The merge commit itself reflects the PR and anyone uninterested in the details can just follow the first parent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants