Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 2.1k
Support third-party stub external dependencies in pytype#9449
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
79ffad645a13666a76900883a6c478dcd72c0aff81ead2b32File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -17,7 +17,20 @@ objects at runtime. | ||
| in the `tests` and `scripts` directories. | ||
| To run the tests, follow the [setup instructions](../CONTRIBUTING.md#preparing-the-environment) | ||
| in the `CONTRIBUTING.md` document. In particular, we recommend running with Python 3.9+. | ||
| in the `CONTRIBUTING.md` document. In particular, you have to run with Python 3.9+. | ||
CollaboratorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I changed the wording here because since #9382, Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In practice we've required 3.9+ for a lot longer, due to the use of CollaboratorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good to know. I believe you could still run other tests, so "recommend" wasn't too inaccurate :P I only noticed because I had 3.8 installed in WSL. | ||
| In order for `pytype_test` and `pyright_test` to work correctly, some third-party stubs | ||
CollaboratorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same wording as before, just added " | ||
| may require extra dependencies external to typeshed to be installed in your virtual environment | ||
| prior to running the test. | ||
| You can list or install all of a stubs package's external dependencies using the following script: | ||
| ```bash | ||
| (.venv3)$ python tests/get_external_stub_requirements.py <third_party_stub> # List external dependencies for <third_party_stub> | ||
| (.venv3)$ python tests/get_external_stub_requirements.py <third_party_stub1> <third_party_stub2> # List external dependencies for <third_party_stub1> and <third_party_stub2> | ||
| (.venv3)$ python tests/get_external_stub_requirements.py # List external dependencies for all third-party stubs in typeshed | ||
| # Install external dependencies for all third-party stubs in typeshed | ||
| (.venv3)$ DEPENDENCIES=$(python tests/get_external_stub_requirements.py) | ||
| (.venv3)$ if [ -n "$DEPENDENCIES" ]; then pip install $DEPENDENCIES; fi | ||
| ``` | ||
| ## Run all tests for a specific stub | ||
| @@ -78,19 +91,6 @@ checks that would typically fail on incomplete stubs (such as `Unknown` checks). | ||
| In typeshed's CI, pyright is run with these configuration settings on a subset of | ||
| the stubs in typeshed (including the standard library). | ||
| In order for `pyright_test` to work correctly, some third-party stubs may require | ||
| dependencies external to typeshed to be installed in your virtual environment | ||
| prior to running the test. | ||
| You can list or install all of a stubs package's external dependencies using the following script: | ||
| ```bash | ||
| (.venv3)$ python tests/get_external_stub_requirements.py <third_party_stub> # List external dependencies for <third_party_stub> | ||
| (.venv3)$ python tests/get_external_stub_requirements.py <third_party_stub1> <third_party_stub2> # List external dependencies for <third_party_stub1> and <third_party_stub2> | ||
| (.venv3)$ python tests/get_external_stub_requirements.py # List external dependencies for all third-party stubs in typeshed | ||
| # Install external dependencies for all third-party stubs in typeshed | ||
| (.venv3)$ DEPENDENCIES=$(python tests/get_external_stub_requirements.py) | ||
| (.venv3)$ if [ -n "$DEPENDENCIES" ]; then pip install $DEPENDENCIES; fi | ||
| ``` | ||
| ## regr\_test.py | ||
| This test runs mypy against the test cases for typeshed's stdlib and third-party | ||
Uh oh!
There was an error while loading. Please reload this page.