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
|
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from distutils.core import setup
from distutils.command.install import install as DistutilsInstall
import os
import sys
import subprocess
if sys.version_info < (3, 5):
print("At least Python 3.5 is required.\n", file=sys.stderr)
exit(1)
def setup_version():
if not os.path.exists(".git"):
# Release version, no .git folder
return
try:
version = subprocess.check_output(("git", "describe", "--always", "--tags", "--dirty"))
with open(os.path.join("mapdamage", "_version.py"), "w") as handle:
handle.write("#!/usr/bin/env python\n")
handle.write("__version__ = %r\n" % (version.decode("utf-8").strip(),))
except (subprocess.CalledProcessError, OSError) as error:
raise SystemExit("Could not determine mapDamage version: %s" % (error,))
class compileInstall(DistutilsInstall):
# extension of the class to account for an extra compiling step
def run(self):
self.record=""
setup_version()
DistutilsInstall.run(self)
# fixing the permission problem of seqtk
setup(
cmdclass={'install': compileInstall},
name='mapdamage',
version='2.2.0',
author='Aurélien Ginolhac, Mikkel Schubert, Ãkon Jónsson',
author_email='MSchubert@snm.ku.dk, jonsson.hakon@gmail.com',
packages=['mapdamage'],
package_data={'mapdamage': ['Rscripts/*.R','Rscripts/stats/*.R','tests/*']},
scripts=['bin/mapDamage'],
url='https://github.com/ginolhac/mapDamage',
license='LICENSE.txt',
description='mapDamage tracks and quantify DNA damage pattern among ancient DNA sequencing reads generated by Next-Generation Sequencing platforms',
long_description=open('README.md').read()
)
|