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

module is installed, but missing library stubs or py.typed marker #364

Closed
ZeeD opened this issue Jan 3, 2024 · 6 comments
Closed

module is installed, but missing library stubs or py.typed marker #364

ZeeD opened this issue Jan 3, 2024 · 6 comments

Comments

@ZeeD
Copy link

ZeeD commented Jan 3, 2024

Hi.
It seems that, while skimming at the code I see it seems well annotated, the distributed library does not expose it.
From what I know from pep 561 it could be enough to just add an empty py.typed in the main package and publish it

@halcy
Copy link
Owner

halcy commented Feb 11, 2024

Do you have any information about how that would work in practice / tooling side? Do I need to run something to export the type information on build, or should the build system just do that?

@ZeeD
Copy link
Author

ZeeD commented Feb 11, 2024

Well, from a cursory glance at your pyproject.toml it seems that you relies on setuptools to build your packages.

If you use the current version of setuptools (69.x.x) it should be enough to just create an empty mastodon/py.typed file in your repo and it should autodetect and include it in the package.

Otherwise, according to pypa/setuptools#3136 it should be necessary to add include_package_data = True and options.package_data * = py.typed

If you share how you build the packages (what commands do you launch, how are they set up, etc) I may try to do the necessary changes

@halcy
Copy link
Owner

halcy commented Feb 11, 2024

I usually just python setup.py sdist bdist_wheel. I will try adding the file.

@halcy
Copy link
Owner

halcy commented Feb 11, 2024

added marker file, hopefully that does the trick

@halcy halcy closed this as completed Feb 11, 2024
@ZeeD
Copy link
Author

ZeeD commented Feb 12, 2024

Hi!
Thank you for the change.
I've just cloned and created a package from main and - indeed - the py.typed is here:

$ python3.12 setup.py sdist bdist_wheel
...
$ unzip -l dist/Mastodon.py-1.8.1-py3-none-any.whl
Archive:  dist/Mastodon.py-1.8.1-py3-none-any.whl
  Length      Date    Time    Name
---------  ---------- -----   ----
...
        0  02-12-2024 10:50   mastodon/py.typed
...
---------                     -------
   385403                     40 files

@jernst
Copy link

jernst commented Jul 16, 2024

Could you re-publish the package with the py.typed to PyPi?

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

No branches or pull requests

3 participants