Skip to content

Commit 166d54d

Browse files
emmatypinggvanrossum
authored andcommitted
Add console scripts (#3074)
Use entry_points instead of custom scripts (but custom scripts remain in case they are still useful).
1 parent 99f372e commit 166d54d

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

mypy/__main__.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,10 @@
22

33
from mypy.main import main
44

5-
main(None)
5+
6+
def console_entry() -> None:
7+
main(None)
8+
9+
10+
if __name__ == '__main__':
11+
main(None)

scripts/stubgen

100755100644
File mode changed.

setup.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,6 @@ def run(self):
9494

9595
package_dir = {'mypy': 'mypy'}
9696

97-
scripts = ['scripts/mypy', 'scripts/stubgen']
98-
if os.name == 'nt':
99-
scripts.append('scripts/mypy.bat')
10097

10198
# These requirements are used when installing by other means than bdist_wheel.
10299
# E.g. "pip3 install ." or
@@ -119,7 +116,8 @@ def run(self):
119116
package_dir=package_dir,
120117
py_modules=[],
121118
packages=['mypy'],
122-
scripts=scripts,
119+
entry_points={'console_scripts': ['mypy=mypy.__main__:console_entry',
120+
'stubgen=mypy.stubgen:main']},
123121
data_files=data_files,
124122
classifiers=classifiers,
125123
cmdclass={'build_py': CustomPythonBuild},

0 commit comments

Comments
 (0)