forked from traverseda/pycraft
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
127 lines (109 loc) · 3.15 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Setup.py file for Hydraulics.
"""
from __future__ import unicode_literals
import os
import re
from setuptools import setup, find_packages
cwd = os.path.abspath(os.path.dirname(__file__))
# ----------------------------------------------------------------------
# Package internal data
# ----------------------------------------------------------------------
project_name = 'pycraft'
classifiers = [
'Programming Language :: Python',
'Natural Language :: English',
'Development Status :: 3 - Alpha',
'Environment :: Console',
'Intended Audience :: Developers',
'License :: MIT',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.5',
]
# Populates package metadata from project internals
package_name = project_name
pattern = r"^__(?P<key>(.*?))__ = '(?P<value>([^']*))'"
engine = re.compile(pattern)
with open(os.path.join(cwd, project_name, '__init__.py'), 'r') as fd:
metadata = {
data['key']: data['value']
for line in fd
for data in [m.groupdict() for m in engine.finditer(line)]
}
# ----------------------------------------------------------------------
# Top level package requirements defined
# ----------------------------------------------------------------------
# Package requirements for execution
requirements = [
'future',
'pyglet',
'noise',
]
# Testing requirements
tests_requirements = [
'mock',
'pyyaml',
'pytest',
'pytest-flake8',
'pytest-cov',
'pytest-xdist'
]
# Documentation requirements
doc_requirements = [
'sphinx',
'sphinx_rtd_theme',
]
# Intended for developers
developer_requirements = [
'ipython',
'bpython',
'ipdb',
]
# Include all available requirements
all_requirements = []
all_requirements.extend(requirements)
all_requirements.extend(tests_requirements)
all_requirements.extend(doc_requirements)
all_requirements.extend(developer_requirements)
# packages = find_packages(include=(namespace,))
packages = find_packages()
lic = open(os.path.join(cwd, 'LICENSE'), 'rb').read()
lic = lic.decode('utf-8')
# ----------------------------------------------------------------------
# Create package
# ----------------------------------------------------------------------
setup(
# Package information
name=package_name,
version=metadata.get('versionstr', '0.1.0'),
description=metadata.get('shortdoc', package_name),
long_description=metadata.get('doc', ''),
url=metadata.get('url', ''),
license=lic,
author=metadata.get('author'),
author_email=metadata.get('email'),
# Package Properties
packages=packages,
include_package_data=True,
platforms=['any'],
classifiers=classifiers,
zip_safe=False,
# Requirements
setup_requires=['pip'],
install_requires=requirements,
extras_require={
'all': all_requirements,
'tests': tests_requirements,
'dev': developer_requirements,
'docs': doc_requirements,
},
tests_require=tests_requirements,
# Scripts and execution
entry_points={
'console_scripts': [
'pycraft=pycraft.main:main'
]
},
)