forked from python/mypy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
74 lines (64 loc) · 2.31 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/usr/bin/env python
import glob
import os
import os.path
import sys
from distutils.core import setup
from mypy.version import __version__
if sys.version_info < (3, 2, 0):
sys.stderr.write("ERROR: You need Python 3.2 or later to use mypy.\n")
exit(1)
version = __version__
description = 'Optional static typing for Python'
long_description = '''
Mypy -- Optional Static Typing for Python
=========================================
Add type annotations to your Python programs, and use mypy to type
check them. Mypy is essentially a Python linter on steroids, and it
can catch many programming errors by analyzing your program, without
actually having to run it. Mypy has a powerful type system with
features such as type inference, gradual typing, generics and union
types.
'''.lstrip()
stubs = []
for py_version in ['3.4', '3.3', '3.2', '2.7']:
base = os.path.join('stubs', py_version)
if not os.path.exists(base):
os.mkdir(base)
stub_dirs = ['']
for root, dirs, files in os.walk(base):
stub_dirs.extend(os.path.relpath(os.path.join(root, stub_dir), base)
for stub_dir in dirs
if stub_dir != '__pycache__')
for stub_dir in stub_dirs:
target = os.path.join('lib', 'mypy', 'stubs', py_version, stub_dir)
files = glob.glob(os.path.join(base, stub_dir, '*.py'))
files += glob.glob(os.path.join(base, stub_dir, '*.pyi'))
stubs.append((target, files))
classifiers = [
'Development Status :: 2 - Pre-Alpha',
'Environment :: Console',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: POSIX',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Topic :: Software Development',
]
setup(name='mypy-lang',
version=version,
description=description,
long_description=long_description,
author='Jukka Lehtosalo',
author_email='[email protected]',
url='http://www.mypy-lang.org/',
license='MIT License',
platforms=['POSIX'],
package_dir={'': 'lib-typing/3.2', 'mypy': 'mypy'},
py_modules=['typing'],
packages=['mypy'],
scripts=['scripts/mypy'],
data_files=stubs,
classifiers=classifiers,
)