-
Notifications
You must be signed in to change notification settings - Fork 7
/
setup.py
executable file
·57 lines (48 loc) · 1.63 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
#!/usr/bin/env python
"""
Install script for the snakefood dependency graph tool.
"""
__author__ = "Martin Blais <[email protected]>"
import os
from os.path import join, isfile
from distutils.core import setup
import sys
# Install all scripts under bin.
scripts = list(filter(isfile, [join('bin', x) for x in os.listdir('bin')]))
def read_version():
try:
return open('VERSION', 'r').readline().strip()
except IOError:
_, e, _ = sys.exc_info()
raise SystemExit(
"Error: you must run setup from the root directory (%s)" % str(e))
# Include all files without having to create MANIFEST.in
def add_all_files(fun):
import os, os.path
from os.path import abspath, dirname, join
def f(self):
for root, dirs, files in os.walk('.'):
if '.hg' in dirs: dirs.remove('.hg')
self.filelist.extend(join(root[2:], fn) for fn in files
if not fn.endswith('.pyc'))
return fun(self)
return f
from distutils.command.sdist import sdist
sdist.add_defaults = add_all_files(sdist.add_defaults)
setup(name="snakefood",
version=read_version(),
description=\
"Dependency Graphing for Python",
long_description="""
Generate dependencies from Python code, filter, cluster and generate graphs
from the dependency list.
""",
license="GPL",
author="Martin Blais",
author_email="[email protected]",
url="http://furius.ca/snakefood",
download_url="http://bitbucket.org/blais/snakefood",
package_dir = {'': 'lib/python'},
packages = ['snakefood', 'snakefood/fallback'],
scripts=scripts
)