Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from austinscchiang/static_typechecking_support
[nbapagerank] add static typechecking (mypy) and linting (black)
- Loading branch information
Showing
2,137 changed files
with
269,430 additions
and
29 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/Users/austinscchiang/Documents/nba_pagerank/env/bin/python3 | ||
# -*- coding: utf-8 -*- | ||
import re | ||
import sys | ||
|
||
from black import patched_main | ||
|
||
if __name__ == '__main__': | ||
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) | ||
sys.exit(patched_main()) |
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,10 @@ | ||
#!/Users/austinscchiang/Documents/nba_pagerank/env/bin/python3 | ||
# -*- coding: utf-8 -*- | ||
import re | ||
import sys | ||
|
||
from black_primer.cli import main | ||
|
||
if __name__ == '__main__': | ||
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) | ||
sys.exit(main()) |
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,10 @@ | ||
#!/Users/austinscchiang/Documents/nba_pagerank/env/bin/python3 | ||
# -*- coding: utf-8 -*- | ||
import re | ||
import sys | ||
|
||
from blackd import patched_main | ||
|
||
if __name__ == '__main__': | ||
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) | ||
sys.exit(patched_main()) |
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,10 @@ | ||
#!/Users/austinscchiang/Documents/nba_pagerank/env/bin/python3 | ||
# -*- coding: utf-8 -*- | ||
import re | ||
import sys | ||
|
||
from mypy.dmypy.client import console_entry | ||
|
||
if __name__ == '__main__': | ||
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) | ||
sys.exit(console_entry()) |
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,10 @@ | ||
#!/Users/austinscchiang/Documents/nba_pagerank/env/bin/python3 | ||
# -*- coding: utf-8 -*- | ||
import re | ||
import sys | ||
|
||
from mypy.__main__ import console_entry | ||
|
||
if __name__ == '__main__': | ||
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) | ||
sys.exit(console_entry()) |
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,55 @@ | ||
#!/Users/austinscchiang/Documents/nba_pagerank/env/bin/python3 | ||
"""Mypyc command-line tool. | ||
Usage: | ||
$ mypyc foo.py [...] | ||
$ python3 -c 'import foo' # Uses compiled 'foo' | ||
This is just a thin wrapper that generates a setup.py file that uses | ||
mypycify, suitable for prototyping and testing. | ||
""" | ||
|
||
import os | ||
import os.path | ||
import subprocess | ||
import sys | ||
import tempfile | ||
import time | ||
|
||
base_path = os.path.join(os.path.dirname(__file__), '..') | ||
|
||
setup_format = """\ | ||
from distutils.core import setup | ||
from mypyc.build import mypycify | ||
setup(name='mypyc_output', | ||
ext_modules=mypycify({}, opt_level="{}"), | ||
) | ||
""" | ||
|
||
def main() -> None: | ||
build_dir = 'build' # can this be overridden?? | ||
try: | ||
os.mkdir(build_dir) | ||
except FileExistsError: | ||
pass | ||
|
||
opt_level = os.getenv("MYPYC_OPT_LEVEL", '3') | ||
|
||
setup_file = os.path.join(build_dir, 'setup.py') | ||
with open(setup_file, 'w') as f: | ||
f.write(setup_format.format(sys.argv[1:], opt_level)) | ||
|
||
# We don't use run_setup (like we do in the test suite) because it throws | ||
# away the error code from distutils, and we don't care about the slight | ||
# performance loss here. | ||
env = os.environ.copy() | ||
base_path = os.path.join(os.path.dirname(__file__), '..') | ||
env['PYTHONPATH'] = base_path + os.pathsep + env.get('PYTHONPATH', '') | ||
cmd = subprocess.run([sys.executable, setup_file, 'build_ext', '--inplace'], env=env) | ||
sys.exit(cmd.returncode) | ||
|
||
if __name__ == '__main__': | ||
main() |
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,10 @@ | ||
#!/Users/austinscchiang/Documents/nba_pagerank/env/bin/python3 | ||
# -*- coding: utf-8 -*- | ||
import re | ||
import sys | ||
|
||
from mypy.stubgen import main | ||
|
||
if __name__ == '__main__': | ||
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) | ||
sys.exit(main()) |
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,10 @@ | ||
#!/Users/austinscchiang/Documents/nba_pagerank/env/bin/python3 | ||
# -*- coding: utf-8 -*- | ||
import re | ||
import sys | ||
|
||
from mypy.stubtest import main | ||
|
||
if __name__ == '__main__': | ||
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) | ||
sys.exit(main()) |
Binary file added
BIN
+38.4 MB
env/lib/python3.7/site-packages/3220aef3144e83d3e26a__mypyc.cpython-37m-darwin.so
Binary file not shown.
Binary file added
BIN
+206 Bytes
env/lib/python3.7/site-packages/__pycache__/_black_version.cpython-37.pyc
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+5.33 KB
env/lib/python3.7/site-packages/__pycache__/mypy_extensions.cpython-37.pyc
Binary file not shown.
Binary file added
BIN
+68.1 KB
env/lib/python3.7/site-packages/__pycache__/typing_extensions.cpython-37.pyc
Binary file not shown.
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 @@ | ||
version = "20.8b1" |
1 change: 1 addition & 0 deletions
1
env/lib/python3.7/site-packages/appdirs-1.4.4.dist-info/INSTALLER
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 @@ | ||
pip |
23 changes: 23 additions & 0 deletions
23
env/lib/python3.7/site-packages/appdirs-1.4.4.dist-info/LICENSE.txt
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,23 @@ | ||
# This is the MIT license | ||
|
||
Copyright (c) 2010 ActiveState Software Inc. | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a | ||
copy of this software and associated documentation files (the | ||
"Software"), to deal in the Software without restriction, including | ||
without limitation the rights to use, copy, modify, merge, publish, | ||
distribute, sublicense, and/or sell copies of the Software, and to | ||
permit persons to whom the Software is furnished to do so, subject to | ||
the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included | ||
in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | ||
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY | ||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | ||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
|
Oops, something went wrong.