rominf
rominf

Reputation: 2845

Stub files are not included in the distribution despite py.typed marker included in the package

I've contributed stub file to ordered-set library. To include stub files I followed recommendations from MyPy and PEP-561. But when I do python setup.py sdist I get distribution without ordered_set.pyi file:

$ tar -tvf dist/ordered-set-*.tar.gz --wildcards '*pyi'
tar: *pyi: Not found in archive
tar: Exiting with failure status due to previous errors

What I'm doing wrong?

Also, where is the code, related to stub files inclusion, in the distutils library? I've searched for it to try to debug my problem, but didn't find anything.

Upvotes: 7

Views: 1414

Answers (1)

rominf
rominf

Reputation: 2845

Robyn Speer (the author of ordered-set library) has found the answer:

Oh, I figured it out. py.typed is something that's supposed to go in the package, and technically, ordered_set doesn't have any packages. It has a module.

In PEP 561, I found: "This PEP does not support distributing typing information as part of module-only distributions. The code should be refactored into a package-based distribution and indicate that the package supports typing as described above."

Upvotes: 6

Related Questions