7 from setuptools import setup, find_packages
8 from setuptools.command.egg_info import egg_info
10 SETUP_DIR = os.path.dirname(__file__) or "."
12 class TagBuildWithCommit(egg_info):
13 """Tag the build with the sha1 and date of the last git commit.
15 If a build tag has already been set (e.g., "egg_info -b", building
16 from source package), leave it alone.
19 if self.tag_build is None:
20 git_tags = subprocess.check_output(
21 ['git', 'log', '--first-parent', '--max-count=1',
22 '--format=format:%ct %h', SETUP_DIR]).split()
23 assert len(git_tags) == 2
24 git_tags[0] = time.strftime(
25 '%Y%m%d%H%M%S', time.gmtime(int(git_tags[0])))
26 self.tag_build = '.{}.{}'.format(*git_tags)
27 return egg_info.tags(self)
30 setup(name='arvados-node-manager',
32 description='Arvados compute node manager',
33 long_description=open(os.path.join(SETUP_DIR, 'README.rst')).read(),
35 author_email='info@arvados.org',
36 url="https://arvados.org",
37 license='GNU Affero General Public License, version 3.0',
38 packages=find_packages(),
41 'arvados-python-client',
45 scripts=['bin/arvados-node-manager'],
47 tests_require=['mock>=1.0'],
49 cmdclass={'egg_info': TagBuildWithCommit},