4823: Added apiconfig option to arvados.api() to accept a dict with
[arvados.git] / sdk / python / setup.py
1 #!/usr/bin/env python
2
3 import os
4 import subprocess
5 import time
6
7 from setuptools import setup, find_packages
8 from setuptools.command.egg_info import egg_info
9
10 SETUP_DIR = os.path.dirname(__file__)
11 README = os.path.join(SETUP_DIR, 'README.rst')
12
13 class TagBuildWithCommit(egg_info):
14     """Tag the build with the sha1 and date of the last git commit.
15
16     If a build tag has already been set (e.g., "egg_info -b", building
17     from source package), leave it alone.
18     """
19     def tags(self):
20         if self.tag_build is None:
21             git_tags = subprocess.check_output(
22                 ['git', 'log', '--first-parent', '--max-count=1',
23                  '--format=format:%ct %h', SETUP_DIR]).split()
24             assert len(git_tags) == 2
25             git_tags[0] = time.strftime(
26                 '%Y%m%d%H%M%S', time.gmtime(int(git_tags[0])))
27             self.tag_build = '.{}+{}'.format(*git_tags)
28         return egg_info.tags(self)
29
30
31 setup(name='arvados-python-client',
32       version='0.1',
33       description='Arvados client library',
34       long_description=open(README).read(),
35       author='Arvados',
36       author_email='info@arvados.org',
37       url="https://arvados.org",
38       download_url="https://github.com/curoverse/arvados.git",
39       license='Apache 2.0',
40       packages=find_packages(),
41       scripts=[
42         'bin/arv-copy',
43         'bin/arv-get',
44         'bin/arv-keepdocker',
45         'bin/arv-ls',
46         'bin/arv-normalize',
47         'bin/arv-put',
48         'bin/arv-run',
49         'bin/arv-ws'
50         ],
51       install_requires=[
52         'python-gflags',
53         'google-api-python-client',
54         'httplib2',
55         'requests>=2.4',
56         'urllib3',
57         'ws4py'
58         ],
59       test_suite='tests',
60       tests_require=['mock>=1.0', 'PyYAML'],
61       zip_safe=False,
62       cmdclass={'egg_info': TagBuildWithCommit},
63       )