-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathsetup.py
executable file
·63 lines (53 loc) · 2.03 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import subprocess
import sys
# Version check prior to non-stdlib imports
if sys.version_info < (3, 5):
sys.stderr.write(
"ERROR: mapDamage requires Python v3.5 or above, but "
"Python v%i.%i was used\n" % sys.version_info[:2]
)
sys.exit(1)
from setuptools import Extension, setup
from setuptools.command.build_py import build_py as SetuptoolsBuildPy
VERSION = "2.3.0a0"
class GitVersionBuild(SetuptoolsBuildPy):
def run(self):
if os.path.exists(".git"):
try:
commit = (
subprocess.check_output(("git", "rev-parse", "--short", "HEAD"))
.decode("utf-8")
.strip()
)
except (subprocess.CalledProcessError, OSError) as error:
raise SystemExit("Could not determine mapDamage version: %s" % (error,))
with open(os.path.join("mapdamage", "_version.py"), "w") as handle:
handle.write("#!/usr/bin/env python\n")
handle.write('__version__ = "{}-{}"\n'.format(VERSION, commit))
super().run()
setup(
cmdclass={"build_py": GitVersionBuild},
name="mapdamage",
version=VERSION,
author="Aurélien Ginolhac, Mikkel Schubert, Hákon Jónsson",
packages=["mapdamage"],
package_data={"mapdamage": ["r/*.r", "r/stats/*.r", "tests/*"]},
entry_points={"console_scripts": ["mapDamage=mapdamage.main:entry_point"]},
url="https://github.com/ginolhac/mapDamage",
license="LICENSE.txt",
description="mapDamage tracks and quantifies DNA damage patterns in ancient DNA sequencing reads generated by Next-Generation Sequencing platforms",
long_description=open("README.md").read(),
long_description_content_type="text/markdown",
python_requires=">=3.5",
install_requires=["coloredlogs", "pysam"],
ext_modules=[
Extension(
"mapdamage.seqtk",
sources=["mapdamage/seqtk/seqtk.c"],
libraries=["z"],
)
],
)