-
Notifications
You must be signed in to change notification settings - Fork 97
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
Update automated tests, pass as-is #301
Open
Avasam
wants to merge
14
commits into
microsoft:main
Choose a base branch
from
Avasam:Update-automated-tests
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+167
−56
Open
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
df2d82f
Update automated tests, pass as-is
Avasam ad3e286
Address PR comments
Avasam b5a257b
Split formatters shell script
Avasam c04314a
Update and fix tests to run from anywhere
Avasam a41f22c
Merge branch 'main' of https://github.com/microsoft/python-type-stubs…
Avasam 4f103f2
Update tests
Avasam 0080da4
Not installing pyright on CI
Avasam e40a34b
Not a TODO
Avasam c914c4a
Merge branch 'main' into Update-automated-tests
Avasam 1b4106c
Merge branch 'main' into Update-automated-tests
Avasam cbdef6d
Set pyright's typeCheckingMode to standard
Avasam 54e908f
Use Python scripts instead and check pyright against pylance-prerelease
Avasam 6623bb3
Forgot to delete run_formatters
Avasam 6177255
Merge branch 'main' into Update-automated-tests
Avasam File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
File renamed without changes.
This file contains 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
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,22 @@ | ||
matplotlib | ||
mypy==0.950 | ||
# Tools used for testing | ||
docopt | ||
mypy==1.11.* | ||
pyright | ||
|
||
# Typed libraries and stubs | ||
matplotlib>=3.8 | ||
pytest | ||
|
||
# Untyped libraries, used to prevent "reportMissingImports" and get inferred typing | ||
joblib | ||
networkx | ||
PyOpenGL | ||
scikit-image | ||
scikit-learn | ||
scipy | ||
typing_extensions==4.2.0 | ||
transformers | ||
vispy | ||
numpydoc | ||
pyamg | ||
traitlets | ||
uarray |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import os | ||
import subprocess | ||
import sys | ||
from pathlib import Path | ||
|
||
|
||
def install_requirements(): | ||
print("\nInstalling requirements...") | ||
return subprocess.run((sys.executable, "-m", "pip", "install", "--upgrade", "isort", "black")) | ||
|
||
|
||
def run_isort(): | ||
print("\nRunning isort...") | ||
return subprocess.run((sys.executable, "-m", "isort", ".")) | ||
|
||
|
||
def run_black(): | ||
print("\nRunning Black...") | ||
return subprocess.run((sys.executable, "-m", "black", ".")) | ||
|
||
|
||
def main(): | ||
test_folder = Path(__file__).parent | ||
root = test_folder.parent | ||
os.chdir(root) | ||
|
||
install_requirements().check_returncode() | ||
results = ( | ||
run_isort(), | ||
run_black(), | ||
) | ||
if sum([result.returncode for result in results]) > 0: | ||
print("\nOne or more tests failed. See above for details.") | ||
else: | ||
print("\nAll tests passed!") | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import os | ||
import subprocess | ||
import sys | ||
from pathlib import Path | ||
|
||
|
||
def install_requirements(test_folder: str): | ||
print("\nInstalling requirements...") | ||
return subprocess.run( | ||
(sys.executable, "-m", "pip", "install", "--upgrade", "-r", os.path.join(test_folder, "requirements.txt")) | ||
) | ||
|
||
|
||
def run_pyright(): | ||
print("\nRunning Pyright...") | ||
# https://github.com/RobertCraigie/pyright-python#keeping-pyright-and-pylance-in-sync | ||
del os.environ["PYRIGHT_PYTHON_FORCE_VERSION"] | ||
os.environ["PYRIGHT_PYTHON_PYLANCE_VERSION"] = "latest-prerelease" | ||
return subprocess.run((sys.executable, "-m", "pyright")) | ||
|
||
|
||
def run_mypy(): | ||
print("\nRunning mypy...") | ||
return subprocess.run((sys.executable, "-m", "mypy")) | ||
|
||
|
||
def main(): | ||
test_folder = Path(__file__).parent | ||
root = test_folder.parent | ||
os.chdir(root) | ||
|
||
install_requirements(test_folder).check_returncode() | ||
results = ( | ||
run_mypy(), | ||
run_pyright(), | ||
) | ||
if sum([result.returncode for result in results]) > 0: | ||
print("\nOne or more tests failed. See above for details.") | ||
else: | ||
print("\nAll tests passed!") | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file was deleted.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tests show several of these
reportUnsupportedDunderAll
diagnostics from pyright. Are they bugs in the stubs? Should we suppress the warning or fix them?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix them (in following PRs, like all other warnings and suppressed errors). The stub is saying that
from module import *
will export a symbol that is missing in the stub itself.In your example,
stubs/matplotlib/dates.pyi
is missing: