File: setup.py

package info (click to toggle)
pplacer 1.1~alpha19-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 5,056 kB
  • sloc: ml: 20,927; ansic: 9,002; python: 1,641; makefile: 171; xml: 50; sh: 33
file content (47 lines) | stat: -rw-r--r-- 1,264 bytes parent folder | download | duplicates (2)
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
try:
    # Prefer setuptools if it exists - cleaner uninstall
    from setuptools import setup
except ImportError:
    from distutils.core import setup

import glob
import os.path
import re
import warnings

VERSION_FILE = '../common_src/version.ml'
VERSION_PATTERN = r'^let version = "(.*)"$'

def get_version():
    """
    parse version
    """
    r = re.compile(VERSION_PATTERN)
    if not os.path.exists(VERSION_FILE):
        return 'unknown'
    with open(VERSION_FILE) as fp:
        for line in fp:
            m = r.match(line)
            if m:
                return m.group(1)
    raise ValueError("Couldn't find version in {0}".format(VERSION_FILE))

def scripts():
    # Scripts depending on biopython
    scripts = [i for i in glob.glob('*.py') if not i.startswith('test_') and i != 'setup.py']

    try:
        # Check for biopython
        import Bio
    except ImportError:
        warnings.warn("BioPython is not installed. Some scripts will not work")

    return scripts

setup(name='pplacer-scripts',
      version=get_version(),
      description='Complementary scripts for use with pplacer',
      author='Erick Matsen, Aaron Gallagher, Connor McCoy, Brian Hodges',
      url='http://matsen.fhcrc.org/pplacer',
      scripts=scripts(),
)