-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathsetup.py
66 lines (54 loc) · 1.66 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
58
59
60
61
62
63
64
65
66
from setuptools import setup
from munin import __version__, __url__
print("""Please make sure to have these third party tools installed:
- moodbar: http://pwsp.net/~qbob/moodbar-0.1.2.tar.gz
- bpm-utils: ttp://www.pogo.org.uk/~mark/bpm-tools/
""")
# Sadly, this does not work on Debian (wat. Debian, get your stuff together.)
# So, we just fake it.
# from pip.req import parse_requirements
import urllib.request
def parse_requirements(url):
text = None
protocol, path = url.split('://', 1)
if protocol == 'file':
try:
with open(path, 'r') as handle:
text = handle.read()
except:
pass
else:
text = urllib.request.urlopen(url).read().decode('utf-8')
for line in text.splitlines():
line = line.strip()
if not line.startswith('#') and line:
yield line
try:
install_reqs = list(parse_requirements('file://pip_requirements.txt'))
except:
install_reqs = list(parse_requirements(
'https://raw.github.com/sahib/libmunin/master/pip_requirements.txt'
))
print('IR', install_reqs)
setup(
name='libmunin',
version=__version__,
description='Fancy library for music recommendations, based on datamining algorithms',
long_description=open('README.rst').read(),
url=__url__,
author='Christopher Pahl',
author_email='[email protected]',
license='GPLv3',
packages=[
'munin',
'munin.distance',
'munin.provider',
'munin.scripts',
'munin.stopwords',
],
package_data={
'munin.stopwords': ['data/*'],
'munin.provider': ['genre.list']
},
install_requires=install_reqs
)