-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup.py
46 lines (42 loc) · 1.49 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
from setuptools import setup, find_packages
import glob
import os
import pkg_resources
from setuptools.command.install import install as _install
# Note: the _program variable is set in __init__.py.
# it determines the name of the package/final command line tool.
from pangolin_assignment import __version__, _program
class install(_install):
def pull_first(self):
"""This script is in a git directory that can be pulled."""
import git
cwd = os.getcwd()
gitdir = os.path.dirname(os.path.realpath(__file__))
os.chdir(gitdir)
g = git.cmd.Git(gitdir)
try:
g.execute(['git', 'lfs', 'pull'])
except git.exc.GitCommandError:
raise RuntimeError("Make sure git-lfs is installed!")
os.chdir(cwd)
def run(self):
self.pull_first()
super().run()
setup(name='pangolin_assignment',
version=__version__,
packages=find_packages(),
scripts=[],
package_data={'pangolin_assignment':['usher_assignments.cache.csv.gz']},
description='cached pangolin assignments',
url='https://github.com/cov-lineages/pangolin-assignment',
author='cov-lineages group',
entry_points="""
[console_scripts]
{program} = pangolin_assignment.command:main
""".format(program = _program),
install_requires=["git-lfs"],
setup_requires=["git-python"],
include_package_data=True,
keywords=[],
cmdclass={'install': install},
zip_safe=False)