Skip to content
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

Enforce return types for typed public functions & mark pkg_resources as py.typed #4409

Merged

Conversation

Avasam
Copy link
Contributor

@Avasam Avasam commented May 31, 2024

Summary of changes

Merge #4390 and #4391 first !

Addresses #4397 (comment)

This also marks pkg_resources as py.typed as it is now more on par (or even improved) over typeshed's stubs. With the exception of extern imports causing a loss of typing, but that's a completely different discussion and pkg_resources as a deprecated module, isn't affected too badly. #4457

Step 4 & 5 of #2345 (comment)

Pull Request Checklist

@Avasam Avasam marked this pull request as ready for review June 24, 2024 17:25
@Avasam Avasam changed the title Enforce return types for public typed functions Enforce return types for typed public functions Jun 24, 2024
@Avasam Avasam force-pushed the pkg_resources-explicit-public-return-annotations branch from 31468cd to 9fcd7fa Compare June 24, 2024 17:34
@Avasam Avasam changed the title Enforce return types for typed public functions Enforce return types for typed public functions & mark pkg_resources as py.typed Jun 24, 2024
…sources-explicit-public-return-annotations
@Avasam
Copy link
Contributor Author

Avasam commented Jul 17, 2024

@abravalheri @jaraco out of all my currently open PRs, this is the one I'd like to prioritise most, as it marks pkg_resources as py.typed, launching the 6 months countdown to remove pkg_resources from typeshed.

I've also been thinking of maybe not enforcing ANN2 on the setuptools side yet, since I'd probably disable it later to progressively type setuptools like I did pkg_resources

Copy link
Member

@jaraco jaraco left a comment

Choose a reason for hiding this comment

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

LGTM. I didn't see any changes in the implementation. Please confirm that's the case.

The only risk with merging this is if we have to back out #4457, probably some of the type checking will need to back off, but that outcome seems unlikely at this point.

pkg_resources/__init__.py Outdated Show resolved Hide resolved
…sources-explicit-public-return-annotations
@Avasam
Copy link
Contributor Author

Avasam commented Jul 20, 2024

I didn't see any changes in the implementation. Please confirm that's the case.

I re-reviewed the PR and I don't see any change in implementation either.

if we have to back out #4457, probably some of the type checking will need to back off, but that outcome seems unlikely at this point.

Even that I feel would be minor.

@jaraco jaraco merged commit b078d6e into pypa:main Jul 20, 2024
21 checks passed
@Avasam Avasam deleted the pkg_resources-explicit-public-return-annotations branch July 20, 2024 21:33
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