Skip to content

Commit

Permalink
properly single sourcing version
Browse files Browse the repository at this point in the history
  • Loading branch information
maxibor committed May 14, 2020
1 parent 2407cdb commit ddf32ad
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion conda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ requirements:
- numpy>=1.17.5
- pandas>=1.0.0
- pip>=20.0.2
- pysam>=0.15.2
- bioconda::pysam>=0.15.2
- scipy>=1.4.1
- statsmodels>=0.11.0
- matplotlib>=3.1.1
Expand Down
2 changes: 1 addition & 1 deletion pydamage/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version__ = '0.1'
from pydamage.main import analyze
from pydamage.version import __version__
2 changes: 1 addition & 1 deletion pydamage/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import sys
from tqdm import tqdm
import warnings
from pydamage.version import __version__
from pydamage import __version__

def analyze(bam, wlen=30, show_al=False, mini=2000, cov=0.5, process=1, outdir="", plot = False, verbose=False, force=False):
"""Runs the pydamage analysis
Expand Down
1 change: 0 additions & 1 deletion pydamage/version.py

This file was deleted.

17 changes: 15 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
from pydamage.version import __version__
from setuptools import setup, find_packages
import codecs
import os.path

def read(rel_path):
here = os.path.abspath(os.path.dirname(__file__))
with codecs.open(os.path.join(here, rel_path), 'r') as fp:
return fp.read()

def get_version(rel_path):
for line in read(rel_path).splitlines():
if line.startswith('__version__'):
delim = '"' if '"' in line else "'"
return line.split(delim)[1]
else:
raise RuntimeError("Unable to find version string.")

setup(
name='pydamage',
version=__version__,
version=get_version("pydamage/__init__.py"),
description='Damage parameter estimation for ancient DNA',
long_description=open("README.md").read(),
url='https://github.com/maxibor/pydamage',
Expand Down

0 comments on commit ddf32ad

Please sign in to comment.