Commit bf6fec2d authored by fabrice's avatar fabrice

Version number following git tag system

parent 850c70a9
......@@ -35,8 +35,13 @@ class AriaEcContactMap(object):
logger.debug("Args:\n" + json.dumps(self.settings.contactmap.args,
indent=4))
# ----------------------------- Input -------------------------------- #
self.outprefix = get_filename(self.settings.contactmap.args.get(
"seq", None)) + self.settings.contactmap.args.get("prefix", "")
if self.settings.contactmap.args.get("prefix"):
self.outprefix = "_".join((get_filename(
self.settings.contactmap.args.get("seq", None)),
self.settings.contactmap.args.get("prefix", "")))
else:
self.outprefix = get_filename(
self.settings.contactmap.args.get("seq", None))
# Load Sequence file
self.protein.set_aa_sequence(self.settings.contactmap.args.get("seq", None))
# Load secondary structure prediction file
......
import os
import subprocess
from setuptools import setup, find_packages, Command
__version_info__ = (0, 0, 0) # MAJOR, MINOR, PATCH
# Fetch version from git tags, and write to version.py.
# Also, when git is not available (PyPi package), use stored version.py.
version_py = os.path.join(os.path.dirname(__file__), 'version.py')
try:
version_git = subprocess.check_output(["git", "describe",
"--tags"]).rstrip()
except subprocess.CalledProcessError:
with open(version_py, 'r') as fh:
version_git = open(version_py).read().strip().split('=')[-1].replace('"',
'')
version_msg = "# Do not edit this file, pipeline versioning is governed by git tags"
with open(version_py, 'w') as pyv:
pyv.write(version_msg + os.linesep + "__version__=" + version_git)
__version_info__ = (0, 1, 0) # MAJOR, MINOR, PATCH
__version__ = '.'.join((str(i) for i in __version_info__))
......@@ -15,7 +31,8 @@ class CleanCommand(Command):
def finalize_options(self):
pass
def run(self):
@staticmethod
def run():
os.system('rm -vrf ./build ./dist ./*.pyc ./*.tgz ./*.egg '
'./*.egg-info')
......@@ -28,7 +45,7 @@ with open('README.rst') as f:
setup(
name="ariaec",
version=__version__,
version="{ver}".format(ver=version_git),
packages=find_packages(),
scripts=['bin/ec2aria.py'],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment