-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathsetup.py
105 lines (91 loc) · 3.69 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
105
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""SPORCO package configuration."""
from __future__ import print_function
from builtins import next
from builtins import filter
import os
from glob import glob
from setuptools import setup
import os.path
from ast import parse
name = 'sporco'
# Get version number from sporco/__init__.py
# See http://stackoverflow.com/questions/2058802
with open(os.path.join(name, '__init__.py')) as f:
version = parse(next(filter(
lambda line: line.startswith('__version__'),
f))).body[0].value.s
packages = ['sporco', 'sporco.prox', 'sporco.admm', 'sporco.pgm',
'sporco.dictlrn']
docdirbase = 'share/doc/%s-%s' % (name, version)
data = [(os.path.join(docdirbase, 'examples/scripts'),
['examples/scripts/index.rst'])]
for d in glob('examples/scripts/*'):
if os.path.isdir(d):
data.append((os.path.join(docdirbase, d),
[os.path.join(d, 'index.rst')] +
glob(os.path.join(d, '*.py'))))
longdesc = \
"""
SPORCO is a Python package for solving optimisation problems with
sparsity-inducing regularisation. These consist primarily of sparse
coding and dictionary learning problems, including convolutional
sparse coding and dictionary learning, but there is also support for
other problems such as Total Variation regularisation and Robust
PCA. The optimisation algorithms in the current version are based
on the Alternating Direction Method of Multipliers (ADMM) or on
the Fast Iterative Shrinkage-Thresholding Algorithm (PGM).
"""
install_requires = ['future', 'numpy', 'scipy', 'imageio', 'matplotlib']
on_rtd = os.environ.get('READTHEDOCS') == 'True'
if on_rtd:
print("Building on ReadTheDocs")
install_requires.append('ipython')
else:
install_requires.append('pyfftw')
tests_require = ['pytest', 'pytest-runner']
setup(
name = name,
version = version,
description = 'Sparse Optimisation Research Code: A Python package ' \
'for sparse coding and dictionary learning',
long_description = longdesc,
keywords = ['Sparse Representations', 'Sparse Coding',
'Dictionary Learning',
'Convolutional Sparse Representations',
'Convolutional Sparse Coding', 'Optimization',
'ADMM', 'PGM'],
platforms = 'Any',
license = 'BSD',
url = 'https://github.com/bwohlberg/sporco',
author = 'Brendt Wohlberg',
author_email = '[email protected]',
packages = packages,
package_data = {'sporco': ['data/*.png', 'data/*.jpg', 'data/*.npz']},
data_files = data,
include_package_data = True,
setup_requires = ['future'],
tests_require = tests_require,
install_requires = install_requires,
extras_require = {
'tests': tests_require,
'docs': ['sphinx >=2.2', 'numpydoc', 'sphinxcontrib-bibtex',
'sphinx_tabs', 'sphinx_fontawesome', 'jonga',
'ipython >=6.3.1', 'jupyter', 'py2jn', 'pypandoc'],
'gpu': ['cupy', 'gputil', 'wurlitzer'],
'optional': ['numexpr', 'mpldatacursor']},
classifiers = [
'License :: OSI Approved :: BSD License',
'Development Status :: 4 - Beta',
'Intended Audience :: Education',
'Intended Audience :: Science/Research',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Topic :: Scientific/Engineering :: Information Analysis',
'Topic :: Scientific/Engineering :: Mathematics',
'Topic :: Software Development :: Libraries :: Python Modules'
],
zip_safe = False
)