setuptools icon indicating copy to clipboard operation
setuptools copied to clipboard

`pkg_resources`: Expose the type of imports and re-exports

Open Avasam opened this issue 1 year ago • 1 comments

Summary of changes

  • ~~Removed unused resource_dir and resource_dir~~ #4260
  • ~~Removed overriden run_main and run_script~~ #4260
  • ~~Moved declarations of @_call_aside defined globals closer to where they're defined. And after ResourceManager & WorkingSet to avoid forward reference issues~~ #4267
  • ~~Typed the 3 globals set by _declare_state as not None~~ #4258
  • Statically exposed the dynamic imports using a TYPE_CHECKING block and static imports

Works towards #2345 and a big step towards merging typeshed's pkg_resources stubs into setuptools

Pull Request Checklist

  • [ ] Changes have tests (this is to help with type-checking checks)
  • [ ] News fragment added in newsfragments/. (See documentation for details)

Avasam avatar Feb 27 '24 23:02 Avasam

Setting as draft to make it clear this isn't a priority to review. Will probably end up being the last pkg_resources PR for static typing.

Avasam avatar May 02 '24 17:05 Avasam

Superseded by #4457 , thanks @jaraco !

Static typing issues caused by vendored packages can now also be fixed upstream

Avasam avatar Jul 17 '24 21:07 Avasam