forked from datalad/datalad
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·121 lines (108 loc) · 3.57 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
#!/usr/bin/env python
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the DataLad package for the
# copyright and license terms.
#
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
import platform
from glob import glob
from os.path import sep as pathsep
from setuptools import setup, find_packages
# manpage build imports
from distutils.command.build_py import build_py
from setup_support import BuildManPage, BuildRSTExamplesFromScripts
from setup_support import get_version
# datalad version to be installed
version = get_version()
# Only recentish versions of find_packages support include
# datalad_pkgs = find_packages('.', include=['datalad*'])
# so we will filter manually for maximal compatibility
datalad_pkgs = [pkg for pkg in find_packages('.') if pkg.startswith('datalad')]
# keyring is a tricky one since it got split into two as of 8.0 and on older
# systems there is a problem installing via pip (e.g. on wheezy) so for those we
# would just ask for keyring
keyring_requires = ['keyring>=8.0', 'keyrings.alt']
pbar_requires = ['tqdm']
dist = platform.dist()
# on oldstable Debian let's ask for lower versions and progressbar instead
if dist[0] == 'gentoo':
pbar_requires = ['progressbar']
if dist[0] == 'debian' and dist[1].split('.', 1)[0] == '7':
keyring_requires = ['keyring<8.0']
pbar_requires = ['progressbar']
requires = {
'core': [
'appdirs',
'GitPython>=2.0.3',
'iso8601',
'humanize',
'mock', # mock is also used for auto.py, not only for testing
'patool>=1.7',
'six>=1.8.0',
] + pbar_requires,
'downloaders': [
'boto',
'msgpack-python',
'requests>=1.2',
] + keyring_requires,
'downloaders-extra': [
'requests_ftp',
],
'crawl': [
'scrapy>=1.1.0rc3', # versioning is primarily for python3 support
],
'publish': [
'jsmin',
],
'tests': [
'BeautifulSoup4', # VERY weak requirement, still used in one of the tests
'httpretty>=0.8.14',
'mock',
'nose>=1.3.4',
'vcrpy',
],
'metadata': [
'simplejson',
'pyld',
'PyYAML', # very optional
]
}
requires['full'] = sum(list(requires.values()), [])
# configure additional command for custom build steps
class DataladBuild(build_py):
def run(self):
self.run_command('build_manpage')
self.run_command('build_examples')
build_py.run(self)
cmdclass = {
'build_manpage': BuildManPage,
'build_examples': BuildRSTExamplesFromScripts,
'build_py': DataladBuild
}
setup(
name="datalad",
author="The DataLad Team and Contributors",
author_email="[email protected]",
version=version,
description="data distribution geared toward scientific datasets",
packages=datalad_pkgs,
install_requires=requires['core'] + requires['downloaders'] + requires['publish'],
extras_require=requires,
entry_points={
'console_scripts': [
'datalad=datalad.cmdline.main:main',
'git-annex-remote-datalad-archives=datalad.customremotes.archives:main',
'git-annex-remote-datalad=datalad.customremotes.datalad:main',
],
},
cmdclass=cmdclass,
package_data={
'datalad': [
'resources/git_ssh.sh',
'resources/sshserver_cleanup_after_publish.sh',
'resources/sshserver_prepare_for_publish.sh',
] +
[p.split(pathsep, 1)[1] for p in glob('datalad/downloaders/configs/*.cfg')]
}
)