forked from google/pytype
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
executable file
·56 lines (46 loc) · 1.48 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
#!/usr/bin/env python
# pylint: disable=bad-indentation
from distutils.core import setup, Extension
import glob
import os
def scan_package_data(path, pattern):
result = []
for subdir, _, _ in os.walk(path):
full_pattern = os.path.join(subdir, pattern)
if glob.glob(full_pattern):
# Once we know that it matches files, we store the pattern itself.
result.append(full_pattern)
return result
typeshed = scan_package_data('typeshed', '*.pyi')
assert 'typeshed/stdlib/2/*.pyi' in typeshed
parser_ext = Extension(
'pytype.pyi.parser_ext',
sources = [
'pytype/pyi/parser_ext.cc',
'pytype/pyi/lexer.lex.cc',
'pytype/pyi/parser.tab.cc',
],
)
setup(
name='pytype',
version='0.2',
description='Python type inferencer',
maintainer='Google',
maintainer_email='[email protected]',
url='http://github.com/google/pytype',
packages=['pytype',
'pytype/pyc',
'pytype/pyi',
'pytype/pytd',
'pytype/pytd/parse',
],
scripts=['scripts/pytype', 'scripts/pytd'],
package_data={'pytype': ['pytd/builtins/*.py*',
'pytd/stdlib/*.pytd',
'pytd/stdlib/*/*.pytd',
] + typeshed},
requires=['pyyaml (>=3.11)'],
install_requires=['pyyaml>=3.11'],
classifier=["Programming Language :: Python :: 2.7"],
ext_modules = [parser_ext],
)