diff --git a/mypy/__main__.py b/mypy/__main__.py index 0a6f79261a53..625242d100be 100644 --- a/mypy/__main__.py +++ b/mypy/__main__.py @@ -2,4 +2,10 @@ from mypy.main import main -main(None) + +def console_entry() -> None: + main(None) + + +if __name__ == '__main__': + main(None) diff --git a/scripts/stubgen b/scripts/stubgen old mode 100755 new mode 100644 diff --git a/setup.py b/setup.py index 78c6a639ad0a..efc23f4a6fe4 100644 --- a/setup.py +++ b/setup.py @@ -94,9 +94,6 @@ def run(self): package_dir = {'mypy': 'mypy'} -scripts = ['scripts/mypy', 'scripts/stubgen'] -if os.name == 'nt': - scripts.append('scripts/mypy.bat') # These requirements are used when installing by other means than bdist_wheel. # E.g. "pip3 install ." or @@ -119,7 +116,8 @@ def run(self): package_dir=package_dir, py_modules=[], packages=['mypy'], - scripts=scripts, + entry_points={'console_scripts': ['mypy=mypy.__main__:console_entry', + 'stubgen=mypy.stubgen:main']}, data_files=data_files, classifiers=classifiers, cmdclass={'build_py': CustomPythonBuild},