13200: Fix for python egg build_tag in setup.cfg
[arvados.git] / sdk / python / setup.py
1 #!/usr/bin/env python
2 # Copyright (C) The Arvados Authors. All rights reserved.
3 #
4 # SPDX-License-Identifier: Apache-2.0
5
6 import os
7 import sys
8 import setuptools.command.egg_info as egg_info_cmd
9
10 from setuptools import setup, find_packages
11
12 SETUP_DIR = os.path.dirname(__file__) or '.'
13 README = os.path.join(SETUP_DIR, 'README.rst')
14
15 tagger = egg_info_cmd.egg_info
16 version = os.environ.get("ARVADOS_BUILDING_VERSION")
17 if not version:
18     try:
19         import gittaggers
20         tagger = gittaggers.EggInfoFromGit
21         import arvados_version
22         vtag = arvados_version.VersionInfoFromGit()
23         version = vtag.git_latest_tag() + vtag.git_timestamp_tag()
24     except ImportError:
25         pass
26
27 short_tests_only = False
28 if '--short-tests-only' in sys.argv:
29     short_tests_only = True
30     sys.argv.remove('--short-tests-only')
31
32 setup(name='arvados-python-client',
33       version=version,
34       description='Arvados client library',
35       long_description=open(README).read(),
36       author='Arvados',
37       author_email='info@arvados.org',
38       url="https://arvados.org",
39       download_url="https://github.com/curoverse/arvados.git",
40       license='Apache 2.0',
41       packages=find_packages(),
42       scripts=[
43           'bin/arv-copy',
44           'bin/arv-get',
45           'bin/arv-keepdocker',
46           'bin/arv-ls',
47           'bin/arv-migrate-docker19',
48           'bin/arv-normalize',
49           'bin/arv-put',
50           'bin/arv-run',
51           'bin/arv-ws'
52       ],
53       data_files=[
54           ('share/doc/arvados-python-client', ['LICENSE-2.0.txt', 'README.rst']),
55       ],
56       install_requires=[
57           'ciso8601 >=1.0.0, <=1.0.4',
58           'future',
59           'google-api-python-client >=1.6.2, <1.7',
60           'httplib2 >=0.9.2',
61           'pycurl >=7.19.5.1',
62           'ruamel.yaml >=0.13.7',
63           'setuptools',
64           'ws4py <0.4',
65       ],
66       test_suite='tests',
67       tests_require=['pbr<1.7.0', 'mock>=1.0', 'PyYAML'],
68       zip_safe=False,
69       cmdclass={'egg_info': tagger},
70       )