-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathsetup.py
65 lines (52 loc) · 1.58 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
import io
import os
from setuptools import setup, find_packages
import sys
install_requires = [
'rope',
]
if sys.version_info < (3, 4):
install_requires.append('enum34')
else:
# We only enable ultan stuff in 3.4+
install_requires.append('ultan')
def local_file(*name):
return os.path.join(
os.path.dirname(__file__),
*name)
def read(name, **kwargs):
with io.open(
name,
encoding=kwargs.get("encoding", "utf8")
) as handle:
return handle.read()
# This is unfortunately duplicated from scripts/cosmic_ray_tooling.py. I
# couldn't find a way to use the original version and still have tox
# work...hmmm...
def read_version(version_file):
"Read the `(version-string, version-info)` from `version.py`."
local_vars = {}
with open(version_file) as handle:
exec(handle.read(), {}, local_vars) # pylint: disable=exec-used
return (local_vars['__version__'], local_vars['__version_info__'])
setup(
name='traad',
version=read_version(local_file('traad', 'version.py'))[0],
packages=find_packages(),
# metadata for upload to PyPI
author='Austin Bingham',
author_email='[email protected]',
description='A JSON+HTTP server for the rope Python refactoring library.',
license='MIT',
keywords='refactoring',
url='http://github.com/abingham/traad',
entry_points={
'console_scripts': [
'traad = traad.server:main',
],
},
install_requires=install_requires,
extras_require={
'test': ['pytest', 'tox', 'webtest'],
},
)