-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update automated tests, pass as-is (#301)
* Update automated tests, pass as-is * Address PR comments * Split formatters shell script * Update and fix tests to run from anywhere * Update tests * Not installing pyright on CI * Not a TODO * Set pyright's typeCheckingMode to standard * Use Python scripts instead and check pyright against pylance-prerelease * Forgot to delete run_formatters * typing_extensions goes under "Typed libraries and stubs" * Bump minimum Python version to 3.9 * Missed mypy target version * Unpin typing_extensions * post-merge fix * use docopt-ng instead of docopt * Add type-var to mypy disable
- Loading branch information
Showing
12 changed files
with
173 additions
and
57 deletions.
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,6 +1,22 @@ | ||
matplotlib | ||
mypy==0.950 | ||
# Tools used for testing | ||
docopt-ng | ||
mypy==1.13.* | ||
pyright | ||
|
||
# Typed libraries and stubs | ||
matplotlib>=3.8 | ||
pytest | ||
scipy-stubs | ||
typing_extensions | ||
|
||
# Untyped libraries, used to prevent "reportMissingImports" and get inferred typing | ||
joblib | ||
networkx | ||
PyOpenGL | ||
scikit-image | ||
scikit-learn | ||
typing_extensions==4.2.0 | ||
transformers | ||
vispy | ||
numpydoc | ||
pyamg | ||
traitlets |
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.