Prepare for adding a py.typed file by moving pytest.py to a package#6302
Closed
bluetech wants to merge 1 commit intopytest-dev:featuresfrom
Closed
Prepare for adding a py.typed file by moving pytest.py to a package#6302bluetech wants to merge 1 commit intopytest-dev:featuresfrom
bluetech wants to merge 1 commit intopytest-dev:featuresfrom
Conversation
Member
Author
|
I hope I made this maneuver successfully - I am not an expert in packaging. References this comment: #3342 (comment) Also, looking into |
Member
|
we should turn it into a deprecated feature so we can remove it later, it might still be used in legacy/private code bases |
While this commit does not do it yet, we want to eventually publish pytest's type annotations. According to PEP561, this is done by adding a `py.typed` file to each top-level package, `pytest` and `_pytest` in pytest's case. However, the `pytest` package is currently just a single module/file, so it's not possible to added to file to it. Change `pytest` to a package (i.e. a directory with `__init__.py`), then adding a `py.typed` file to it is possible. The reason for doing it already is that it makes it easy to ask people to test the types just by touching a couple of files.
9c664f3 to
85d8c07
Compare
Member
Author
|
Closing in favor of #6304. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
While this commit does not do it yet, we want to eventually publish
pytest's type annotations. According to PEP561, this is done by adding a
py.typedfile to each top-level package,pytestand_pytestinpytest's case. However, the
pytestpackage is currently just a singlemodule/file, so it's not possible to added to file to it.
Change
pytestto a package (i.e. a directory with__init__.py), thenadding a
py.typedfile to it is possible.The reason for doing it already is that it makes it easy to ask people
to test the types just by touching a couple of files.