edornd / argdantic

Typed command line interfaces with argparse and pydantic
MIT License
38 stars 4 forks source link

feat: Add py.typed file #38

Closed fennerm closed 7 months ago

fennerm commented 8 months ago

argdantic appears to be type hinted but the type hints are not usable by type checkers. Adding a py.typed file seems to resolve.

https://peps.python.org/pep-0561/#:~:text=In%20order%20to%20make%20packaging,to%20their%20package%20supporting%20typing.

edornd commented 7 months ago

Again good find @fennerm, just one comment: I always try to include type hints, however I never use a type checker in python (mostly because they're hints, mostly just to remember stuff and make the IDE help me). It looks like this will solve the checker issue, but the type hints I placed were never checked with mypy for instance. Do you think this will be a problem?

fennerm commented 7 months ago

Hey @edornd, I see, then yes that would be a problem. I do now see some cases in the codebase where the hint would cause a mypy error. I guess its better to close this PR in that case. I'll just go ahead and ignore typing errors for argdantic in our codebase.