You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Could I please ask that someone help me out with where to place the py.typed file? I'm aware of where to place it in a Python project, but in ujson it's all C extensions
I've tried to just put it in the root, but then, in a separate virtual environment, if I do
$ uv pip uninstall ujsonUninstalled 1 package in 12ms - ujson==5.10.0
$ uv pip install git+https://github.com/MarcoGorelli/ultrajson.git --no-cache Updated https://github.com/MarcoGorelli/ultrajson.git (2ea54f6a1d1b8e2bc3a27c491a63238cf244f087)Resolved 1 package in 5.34s Built ujson @ git+https://github.com/MarcoGorelli/ultrajson.git@2ea54f6a1d1b8e2bc3a27c491a63238cf244f087Prepared 1 package in 7.42sInstalled 1 package in 3ms + ujson==0.1.dev969 (from git+https://github.com/MarcoGorelli/ultrajson.git@2ea54f6a1d1b8e2bc3a27c491a63238cf244f087)
A py.typed file has to be shipped as part of a package.
So it would be ujson/__init__.pyi + ujson/py.typed. Not ujson.pyi. If ujson doesn't ship as a package, this would require changes to the distribution to make it so.
Alternatively: ujson-stubs/__init__.pyi will automatically be treated as a stub for a ujson module. No need for a py.typed. It's what typeshed does.
Uh oh!
There was an error while loading. Please reload this page.
typeshed currently hosts stubs for ujson: https://github.com/python/typeshed/tree/main/stubs/ujson
I asked ujson if they'd be happy to inline the stubs, and it looks like they would! ultrajson/ultrajson#671
I've given this a go here: https://github.com/MarcoGorelli/ultrajson/tree/inline-stubs
Could I please ask that someone help me out with where to place the
py.typed
file? I'm aware of where to place it in a Python project, but in ujson it's all C extensionsI've tried to just put it in the root, but then, in a separate virtual environment, if I do
and then make a file
t.py
withand run
mypy t.py
, then I seeAny help towards this would be appreciated 🙏 Ultimately, the benefit to typeshed would be fewer stubs to maintain here
The text was updated successfully, but these errors were encountered: