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

Package does not include the py.typed file? #1610

Closed
AustinScola opened this issue Apr 8, 2022 · 4 comments · Fixed by #1648
Closed

Package does not include the py.typed file? #1610

AustinScola opened this issue Apr 8, 2022 · 4 comments · Fixed by #1648

Comments

@AustinScola
Copy link

While the repo has a py.typed file and uses annotations, I don't think the py.typed file is being packaged which causes the following error when type checking code which imports piptools:

error: Skipping analyzing "piptools": module is installed, but missing library stubs or py.typed marker  [import]
note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports

I think the solution is to just include package_data = ["py.typed"] in setup.cfg.

As a bonus the classifier Typing :: Typed could also be added.

@FlorentJeannot
Copy link
Contributor

Hello @AustinScola,

FYI, I made a PR to fix this. Just out of curiosity, why do you need to import piptools in your code?

@AustinScola
Copy link
Author

Just out of curiosity, why do you need to import piptools in your code?

I have a wrapper script around piptools that adds functionality.

@FlorentJeannot
Copy link
Contributor

Interesting, is this something we could integrate into pip-tools?

@AustinScola
Copy link
Author

Maybe? It lets me use a config file to give names to specifications of requirements files and to freeze multiple specifications at once

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 a pull request may close this issue.

2 participants