pfmoore / editables

MIT License
39 stars 11 forks source link

Add the necessary metadata for type hints #30

Closed gotmax23 closed 1 year ago

gotmax23 commented 1 year ago

See the commit messages for more details.

Relates: https://github.com/pfmoore/editables/pull/27

gotmax23 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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!