Skip to content

Conversation

@squahtx
Copy link
Contributor

@squahtx squahtx commented Dec 2, 2021

Otherwise mypy won't pick up the type hints in downstream packages.

@squahtx squahtx requested a review from a team as a code owner December 2, 2021 20:45
Comment on lines +20 to +21
[options.package_data]
matrix_common = py.typed
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not seen this before.
My approach was to use MANIFEST.in.

http://blog.codekills.net/2011/07/15/lies,-more-lies-and-python-packaging-documentation-on--package_data-/ suggests that package_data is full of lies and you should prefer MANIFEST.in since that works for both sdist and bdists whereas package_data doesn't work for source distributions.

The modern way to do both a sdist and a bdist seems to be python -m build --sdist --wheel. With the lines you have written, both options seem to include this file. As a result, I think the concern above may be historical.
(N.B. seems like you need to reinstall the package in the venv before changes to setup.cfg take effect)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm a bit confused about the difference between MANIFEST.in and package_data now. The latter seems to do the right thing for us but there are a bunch of posts suggesting to use the former.

I'll go with package_data for now since it seems to work.

@squahtx squahtx merged commit 64fa874 into main Dec 3, 2021
@squahtx squahtx deleted the squah/pep_561 branch December 3, 2021 15:45
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

Successfully merging this pull request may close these issues.

3 participants