This repository has been archived by the owner on Jun 14, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 41
/
setup.py
166 lines (144 loc) · 4.4 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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Main installation file for GeoBases.
"""
from __future__ import with_statement
from sys import stderr
from os import getenv
import os.path as op
from setuptools import setup
INSTALL_REQUIRES = [
# Public - core
'pyyaml',
'python_geohash',
'python_Levenshtein',
'fuzzy',
# Public - CLI
'argparse',
'termcolor',
'colorama'
]
EXTRAS_REQUIRE = {
# Private
'OpenTrep': ['OpenTrepWrapper>=0.6']
}
DEPENDENCY_LINKS = []
DEPENDENCY_LINKS_EXTRAS = {
'OpenTrep' : ['https://github.com/trep/wrapper/tarball/master#egg=OpenTrepWrapper-0.7']
}
# Managing OpenTrep dependency
WITH_OPENTREP = getenv('WITH_OPENTREP', None)
if WITH_OPENTREP == '1':
# Forcing OpenTrepWrapper support
INSTALL_REQUIRES.extend(EXTRAS_REQUIRE['OpenTrep'])
DEPENDENCY_LINKS.extend(DEPENDENCY_LINKS_EXTRAS['OpenTrep'])
print >> stderr, '/!\ Adding "%s" to mandatory dependencies' % \
str(EXTRAS_REQUIRE['OpenTrep'])
else:
print >> stderr, '/!\ Installing without "%s"' % \
str(EXTRAS_REQUIRE['OpenTrep'])
try:
# monkey patch: Crack SandboxViolation verification from
# http://www.cubicweb.org/1422923
#import setuptools.command.easy_install # only if easy_install avaible
from setuptools.sandbox import DirectorySandbox as DS
def _ok(*_):
"""Return True if ``path`` can be written during installation."""
return True
DS._ok = _ok
except ImportError:
raise
# local files handling
def local(rel_path, root_file=__file__):
"""Handle local paths.
"""
return op.join(op.realpath(op.dirname(root_file)), rel_path)
with open(local('VERSION')) as fl:
VERSION = fl.read().rstrip()
with open(local('README.rst')) as fl:
LONG_DESCRIPTION = fl.read()
with open(local('LICENSE')) as fl:
LICENSE = fl.read()
setup(
name = 'GeoBases',
version = VERSION,
author = 'Alex Prengère',
author_email = '[email protected]',
url = 'http://opentraveldata.github.com/geobases',
description = 'Data services and visualization',
long_description = LONG_DESCRIPTION,
license = LICENSE,
#
# Manage standalone scripts
entry_points = {
'console_scripts' : [
'GeoBase = GeoBaseMain:main'
]
},
#packages=find_packages(),
packages = [
'GeoBases'
],
py_modules = [
'GeoBaseMain'
],
dependency_links = DEPENDENCY_LINKS,
install_requires = INSTALL_REQUIRES,
extras_require = EXTRAS_REQUIRE,
package_dir = {
'GeoBases': 'GeoBases'
},
package_data = {
'GeoBases': [
"DataSources/Sources.yaml",
"DataSources/CheckDataUpdates.sh",
"completion/*",
"MapAssets/*",
"TableAssets/*",
"GraphAssets/*",
"DataSources/*/*.csv",
"DataSources/*/*.zip",
"DataSources/*/*.txt",
"DataSources/*/*/*.csv",
"DataSources/*/*/*.txt",
"DataSources/*/*/*.zip",
]
},
#scripts = [
# 'GeoBases/DataSources/CheckDataUpdates.sh'
#],
data_files = [
# Tests should not be exported
#('test', [
# 'test/test_GeoBases.py'
#]),
# Will create dir if needed
(op.join(getenv('HOME', '.'), '.zsh/completion'), [
'GeoBases/completion/_GeoBase'
])
],
classifiers=[
'License :: Free for non-commercial use',
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Intended Audience :: End Users/Desktop',
'Intended Audience :: Information Technology',
'Intended Audience :: Science/Research',
'Intended Audience :: System Administrators',
'Environment :: Console',
'Environment :: Web Environment',
'Operating System :: POSIX',
'Operating System :: POSIX :: Linux',
'Operating System :: Unix',
'Programming Language :: Python',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: JavaScript',
'Topic :: Terminals',
'Topic :: Scientific/Engineering',
'Topic :: Scientific/Engineering :: Visualization',
'Topic :: Software Development :: Libraries :: Python Modules',
],
)