Skip to content

Inline type stubs from typeshed#172

Open
MarcoGorelli wants to merge 1 commit intodecalage2:masterfrom
MarcoGorelli:inline-stubs
Open

Inline type stubs from typeshed#172
MarcoGorelli wants to merge 1 commit intodecalage2:masterfrom
MarcoGorelli:inline-stubs

Conversation

@MarcoGorelli
Copy link
Copy Markdown

closes #166

Stubs are taken from: https://github.com/python/typeshed/tree/main/stubs/olefile/olefile

Other changes:

  • I used sys.version_info to do Python2 vs Python3 branching, then MyPy doesn't require extra type: ignores (it's also probably more robust?)
  • I added a CI workflow which runs stubtest and mypy to check that the stubs remain valid, and that no extra nor extraneous symbols appear

Advantages of having the type stubs inlined are:

  • when people pip install olefile, they get the stubs automatically
  • it becomes easier to keep the stubs up-to-date

@MarcoGorelli MarcoGorelli marked this pull request as ready for review June 17, 2025 13:58
@decalage2 decalage2 self-requested a review June 18, 2025 08:09
@decalage2 decalage2 self-assigned this Jun 18, 2025
@decalage2 decalage2 added this to the olefile 0.50 milestone Jun 18, 2025
@decalage2
Copy link
Copy Markdown
Owner

I think this PR is still valuable, I just haven't had time yet to test it.

@decalage2 decalage2 reopened this Jan 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Type hints

2 participants