7 from setuptools import setup, find_packages
8 from setuptools.command.egg_info import egg_info
10 SETUP_DIR = os.path.dirname(__file__)
11 README = os.path.join(SETUP_DIR, 'README.rst')
13 class TagBuildWithCommit(egg_info):
14 """Tag the build with the sha1 and date of the last git commit.
16 If a build tag has already been set (e.g., "egg_info -b", building
17 from source package), leave it alone.
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)
31 setup(name='arvados-python-client',
33 description='Arvados client library',
34 long_description=open(README).read(),
36 author_email='info@arvados.org',
37 url="https://arvados.org",
38 download_url="https://github.com/curoverse/arvados.git",
40 packages=find_packages(),
53 'google-api-python-client',
60 tests_require=['mock>=1.0', 'PyYAML'],
62 cmdclass={'egg_info': TagBuildWithCommit},