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 a (potentially temporary) py.typed file? #11945

Closed
person142 opened this issue Apr 26, 2020 · 3 comments · Fixed by #11946
Closed

Add a (potentially temporary) py.typed file? #11945

person142 opened this issue Apr 26, 2020 · 3 comments · Fixed by #11946
Labels
needs-decision Items that need further discussion before they are merged or closed static typing Items related to static typing
Milestone

Comments

@person142
Copy link
Member

This came up in #11936 (comment).

As of right now type checkers would ignore an installed version of SciPy because we don't have a py.typed file per PEP 561:

https://www.python.org/dev/peps/pep-0561/#packaging-type-information

This makes it harder for downstream projects that want to test out the types we are adding. What do people think about adding that py.typed file now so that people can try the types out, and then removing for the next release if the types aren't ready? (Though I hope at least a rudimentary form of them will be.)

This might mean that downstream experimenters have to ignore some errors in their configs, but that seems like a reasonable trade-off.

@person142 person142 added needs-decision Items that need further discussion before they are merged or closed static typing Items related to static typing labels Apr 26, 2020
@person142 person142 changed the title Add a (potentially empty) py.typed file? Add a (potentially temporary) py.typed file? Apr 26, 2020
@person142
Copy link
Member Author

Note that the py.typed file doesn't contain anything fancy-it's just an empty file that serves as a marker.

@rgommers
Copy link
Member

Seems reasonable. I can't think of something that will break and can't be easily fixed by copying the ignores we have in our mypy.ini.

@person142
Copy link
Member Author

Ping @rth: if you want to test things against the SciPy stubs, now you just:

  • Install the mypy_requirements.txt
  • Install SciPy from master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-decision Items that need further discussion before they are merged or closed static typing Items related to static typing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants