forked from Parisson/TimeSide
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
104 lines (88 loc) · 3.64 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
92
93
94
95
96
97
98
99
100
101
102
103
104
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import 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 = []
package_map = {
'pytables': 'tables', # insert 'tables' instead of 'pytables'
'yaafe': '',
'essentia': '',
'pytorch': '',
# Yaafe and essentia are not seen by pip during pip install -e .
# and not visible with pip list
# TODO: check if setuptools can help
}
for dep in environment['dependencies']:
if isinstance(dep, str) and not(dep.startswith('python')):
if dep in package_map:
conda_dependencies.append(package_map[dep])
else:
conda_dependencies.append(dep)
elif isinstance(dep, dict) and 'pip' in dep:
pip_dependencies = dep['pip']
return pip_dependencies
# Pytest
class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = ['tests', '--ignore', 'tests/sandbox', '--verbose', '--ds=app.test_settings']
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="yomguy@parisson.com, piem@piem.org, thomas@parisson.com, riccardo.zaccarelli@gmail.com, olivier@samalyse.com",
version='1.0.0',
setup_requires=['pyyaml'],
# install_requires=[get_dependencies('environment-pinned.yml')],
platforms=['OS Independent'],
license='Gnu Public License V2',
classifiers=CLASSIFIERS,
keywords=KEYWORDS,
packages=['timeside'],
include_package_data=True,
zip_safe=False,
scripts=['bin/timeside-waveforms', 'bin/timeside-launch'],
tests_require=['pytest>=3', 'pytest-django'],
cmdclass={'test': PyTest},
)