8000 move mypyc to console_scripts (#11494) · DeepSourceCorp/mypy@e7f698a · GitHub
[go: up one dir, main page]

Skip to content

Commit e7f698a

Browse files
imba-tjdtushar-deepsource
authored andcommitted
move mypyc to console_scripts (python#11494)
Description See mypyc/mypyc#893
1 parent 384e62f commit e7f698a

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

scripts/mypyc renamed to mypyc/__main__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#!/usr/bin/env python3
21
"""Mypyc command-line tool.
32
43
Usage:
@@ -27,6 +26,7 @@
2726
)
2827
"""
2928

29+
3030
def main() -> None:
3131
build_dir = 'build' # can this be overridden??
3232
try:
@@ -49,5 +49,6 @@ def main() -> None:
4949
cmd = subprocess.run([sys.executable, setup_file, 'build_ext', '--inplace'], env=env)
5050
sys.exit(cmd.returncode)
5151

52+
5253
if __name__ == '__main__':
5354
main()

mypyc/doc/dev-intro.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,11 @@ compiled code. For example, you may want to do interactive testing or
7373
to run benchmarks. This is also handy if you want to inspect the
7474
generated C code (see Inspecting Generated C).
7575

76-
Run `scripts/mypyc` to compile a module to a C extension using your
76+
Run `mypyc` to compile a module to a C extension using your
7777
development version of mypyc:
7878

7979
```
80-
$ scripts/mypyc program.py
80+
$ mypyc program.py
8181
```
8282

8383
This will generate a C extension for `program` in the current working

mypyc/test/test_commandline.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ def run_case(self, testcase: DataDrivenTestCase) -> None:
4747
out = b''
4848
try:
4949
# Compile program
50-
cmd = subprocess.run([sys.executable,
51-
os.path.join(base_path, 'scripts', 'mypyc')] + args,
50+
cmd = subprocess.run([sys.executable, '-m', 'mypyc', *args],
5251
stdout=subprocess.PIPE, stderr=subprocess.STDOUT, cwd='tmp')
5352
if 'ErrorOutput' in testcase.name or cmd.returncode != 0:
5453
out += cmd.stdout

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,11 +181,11 @@ def run(self):
181181
ext_modules=ext_modules,
182182
packages=find_packages(),
183183
package_data={'mypy': package_data},
184-
scripts=['scripts/mypyc'],
185184
entry_points={'console_scripts': ['mypy=mypy.__main__:console_entry',
186185
'stubgen=mypy.stubgen:main',
187186
'stubtest=mypy.stubtest:main',
188187
'dmypy=mypy.dmypy.client:console_entry',
188+
'mypyc=mypyc.__main__:main',
189189
]},
190190
classifiers=classifiers,
191191
cmdclass=cmdclass,

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ description = type check ourselves
5151
basepython = python3.7
5252
commands =
5353
python -m mypy --config-file mypy_self_check.ini -p mypy -p mypyc
54-
python -m mypy --config-file mypy_self_check.ini misc/proper_plugin.py scripts/mypyc
54+
python -m mypy --config-file mypy_self_check.ini misc/proper_plugin.py
5555

5656
[testenv:docs]
5757
description = invoke sphinx-build to build the HTML docs

0 commit comments

Comments
 (0)
0