Skip to content

Inline stubs#674

Merged
bwoodsend merged 8 commits into
ultrajson:mainfrom
MarcoGorelli:inline-stubs
Jun 12, 2025
Merged

Inline stubs#674
bwoodsend merged 8 commits into
ultrajson:mainfrom
MarcoGorelli:inline-stubs

Conversation

@MarcoGorelli

Copy link
Copy Markdown
Contributor

Fixes #671

Changes proposed in this pull request:

  • Inline ujson stubs so they can be removed from typeshed
  • Run stubtest in CI
  • Include packages = ujson-stubs in setup.cfg

@MarcoGorelli MarcoGorelli changed the title inline stubs Inline stubs Jun 11, 2025
@MarcoGorelli MarcoGorelli marked this pull request as ready for review June 11, 2025 09:02
@hugovk hugovk added the changelog: Added For new features label Jun 11, 2025
@bwoodsend

Copy link
Copy Markdown
Collaborator

Typing :: Typed classifier?

Comment thread .github/workflows/test.yml Outdated
Comment on lines +67 to +72
- name: Stubtest
if: "!startsWith(matrix.python-version, 'pypy')"
run: |
# Check that stubs have no omitted / extraneous symbols.
# This does not check the signatures: https://github.com/python/mypy/issues/19261.
python -m mypy.stubtest ujson

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we need to run this on all operating systems with (nearly) all Python versions, or is just one okay? If just one, we can move it to lint.yml.

It only takes a couple of seconds to run, so that's not a problem.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

sure, done, thanks!

@Avasam Avasam Jun 11, 2025

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

If you expose the same symbol names for all environments, then a single run should cover everything.

Since c module extensions signatures can't be checked, you don't even need to bother with function signatures that would differ on, let's say Windows vs macOS.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

sure, thanks @Avasam - I've done that in lint.yml, so there should just be a single run

Comment thread .github/workflows/lint.yml Outdated
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>

@hugovk hugovk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@bwoodsend bwoodsend merged commit ae07172 into ultrajson:main Jun 12, 2025
61 of 63 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog: Added For new features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inline type stubs, add py.typed

4 participants