forked from Parisson/TimeSide
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
executable file
·91 lines (78 loc) · 3.34 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os, sys
from setuptools import setup
from setuptools.command.test import test as TestCommand
# Utility function to read file in the setup.py directory
def open_here(fname):
return open(os.path.join(os.path.dirname(__file__), fname))
def get_dependencies(env_yml_file):
"""
Read the dependencies from a Conda environment file in YAML
and return a list of such dependencies (from conda and pip list)
Be sure to match packages specification for each of:
- Conda : http://conda.pydata.org/docs/spec.html#build-version-spec
- Pip & Setuptool :
- http://pythonhosted.org/setuptools/setuptools.html?highlight=install_require#declaring-dependencies
- https://pythonhosted.org/setuptools/pkg_resources.html#requirement-objects
"""
import yaml
with open_here(env_yml_file) as f:
environment = yaml.load(f)
conda_dependencies = []
for dep in environment['dependencies']:
if isinstance(dep, str) and not(dep.startswith('python')):
if dep.startswith('pytables'):
conda_dependencies.append(dep[2:]) # insert 'tables' instead of 'pytables'
else:
conda_dependencies.append(dep)
elif isinstance(dep, dict) and 'pip' in dep:
pip_dependencies = dep['pip']
return conda_dependencies + pip_dependencies
# Pytest
class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = ['tests', '--ignore', 'tests/sandbox', '--verbose']
self.test_suite = True
def run_tests(self):
#import here, cause outside the eggs aren't loaded
import pytest
errno = pytest.main(self.test_args)
sys.exit(errno)
CLASSIFIERS = [
'Intended Audience :: Science/Research',
'Intended Audience :: Developers',
'Intended Audience :: Information Technology',
'Programming Language :: Python',
'Programming Language :: JavaScript',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
'Topic :: Multimedia :: Sound/Audio',
'Topic :: Multimedia :: Sound/Audio :: Analysis',
'Topic :: Multimedia :: Sound/Audio :: Players',
'Topic :: Multimedia :: Sound/Audio :: Conversion',
'Topic :: Scientific/Engineering :: Information Analysis',
'Topic :: Software Development :: Libraries :: Python Modules',
]
KEYWORDS = 'audio analysis features extraction MIR transcoding graph visualize plot HTML5 interactive metadata player'
setup(
name='TimeSide',
url='https://github.com/Parisson/TimeSide/',
description="Audio processing framework for the web",
long_description=open_here('README.rst').read(),
author="Guillaume Pellerin, Paul Brossier, Thomas Fillon, Riccardo Zaccarelli, Olivier Guilyardi",
author_email="[email protected], [email protected], [email protected], [email protected], [email protected]",
version='0.8.1',
setup_requires=['pyyaml'],
install_requires=[get_dependencies('environment.yml')],
platforms=['OS Independent'],
license='Gnu Public License V2',
classifiers=CLASSIFIERS,
keywords=KEYWORDS,
packages=['timeside'],
include_package_data=True,
zip_safe=False,
scripts=['scripts/timeside-waveforms', 'scripts/timeside-launch'],
tests_require=['pytest'],
cmdclass={'test': PyTest},
)