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

Add the necessary metadata for type hints #30

Merged
merged 2 commits into from
Jul 8, 2023
Merged

Conversation

gotmax23
Copy link
Contributor

@gotmax23 gotmax23 commented Jul 8, 2023

See the commit messages for more details.

Relates: #27

gotmax23 added 2 commits July 8, 2023 01:23
Type hints were added in pfmoore#27,
but the py.typed file to make tools actually recognize them was not.
This signifies to users on PyPI that this library has type annotations.
@gotmax23
Copy link
Contributor Author

gotmax23 commented Jul 8, 2023

Confirming that the py.typed file is included in the sdist and the wheel:

$ pyproject-build
$ bsdtar tf dist/editables-0.4.tar.gz | grep py.typed
editables-0.4/src/editables/py.typed
$ bsdtar tf dist/editables-0.4-py3-none-any.whl | grep py.typed
editables/py.typed

@pfmoore
Copy link
Owner

pfmoore commented Jul 8, 2023

Thanks, I wasn't aware of this. The classifier seems innocuous, although I don't know what benefit is gained by having it - could you explain? It feels like I'm somehow making a point of the fact that I have type annotations, whereas in fact it's only intended as a small convenience for people who care. What is lost if I don't include this?

Similarly with the py.typed file - what is lost if I don't include this? The type annotations are present, why would type checkers not use them without the file being present?

Sorry for being picky, but I want to make sure I understand what I'm adding, so I can maintain it properly going forward.

Edit: I've asked on the typing-sig mailing list what I'm missing by not having a py.typed file. I'll see what response I get from there.

@pfmoore
Copy link
Owner

pfmoore commented Jul 8, 2023

Apparently, if I don't have py.typed, type checkers will ignore the annotations. I find that pretty silly, but if that's the way it is... 🤷 I don't see the point in having the classifier, but I can't say I care that much so I'm happy to add it.

Thanks for bringing this to my attention!

@pfmoore pfmoore merged commit 38f210e into pfmoore:main Jul 8, 2023
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.

2 participants