Skip to content

Commit

Permalink
Make typing and typed-ast external dependencies.
Browse files Browse the repository at this point in the history
This will automatically install the typing and typed-ast packages when
appropriate.

The setup.py file now depends on setuptools.  We should build wheels
so that users installing from PyPI won't need setuptools.  In order to
build wheels the distribution builder/uploader needs to install the
wheel package.  To manage those dependencies, I've added
build-requirements.txt.

In summary:
  - python3 -m pip install -r build-requirements.txt
  - python3 setup.py bdist_wheel
  - upload the .whl file that appears in the dist/ subdirectory to PyPI
  • Loading branch information
Guido van Rossum committed Nov 15, 2016
1 parent 507d2ff commit 303334e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
recursive-include lib-typing *.py
recursive-include scripts *
recursive-exclude scripts myunit
2 changes: 2 additions & 0 deletions build-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
setuptools
wheel
16 changes: 11 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
sys.stderr.write("ERROR: You need Python 3.2 or later to use mypy.\n")
exit(1)

from distutils.core import setup
from distutils.command.build_py import build_py
from setuptools import setup
from setuptools.command.build_py import build_py
from mypy.version import base_version
from mypy import git

Expand Down Expand Up @@ -81,18 +81,23 @@ def run(self):
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Topic :: Software Development',
]


package_dir = {'mypy': 'mypy'}
if sys.version_info < (3, 5, 0):
package_dir[''] = 'lib-typing/3.2'

scripts = ['scripts/mypy', 'scripts/stubgen']
if os.name == 'nt':
scripts.append('scripts/mypy.bat')

install_requires = []
if sys.platform != 'win32':
install_requires.append('typed-ast >= 0.6.1')
if sys.version_info < (3, 5):
install_requires.append('typing >= 3.5.2')

setup(name='mypy-lang',
version=version,
description=description,
Expand All @@ -103,10 +108,11 @@ def run(self):
license='MIT License',
platforms=['POSIX'],
package_dir=package_dir,
py_modules=['typing'] if sys.version_info < (3, 5, 0) else [],
py_modules=[],
packages=['mypy'],
scripts=scripts,
data_files=data_files,
classifiers=classifiers,
cmdclass={'build_py': CustomPythonBuild},
install_requires=install_requires,
)

0 comments on commit 303334e

Please sign in to comment.