forked from magenta/magenta
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
182 lines (173 loc) · 7.59 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
# Copyright 2020 The Magenta Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""A setuptools based setup module for magenta."""
from setuptools import find_packages
from setuptools import setup
# Bit of a hack to parse the version string stored in version.py without
# executing __init__.py, which will end up requiring a bunch of dependencies to
# execute (e.g., tensorflow, pretty_midi, etc.).
# Makes the __version__ variable available.
with open('magenta/version.py') as in_file:
exec(in_file.read()) # pylint: disable=exec-used
REQUIRED_PACKAGES = [
'IPython',
'Pillow >= 3.4.2',
'absl-py',
'attrs',
'backports.tempfile',
'bokeh >= 0.12.0',
# Temporary fix for gast issue with TF.
# Details:
# https://github.com/tensorflow/tensorflow/issues/32319
# https://github.com/tensorflow/tensorflow/commit/c72125bd59858ec82a9238b232bbd77c45889c5a
'gast == 0.2.2',
# tensor2tensor requires gym, but the newest version of gym depends on a
# a version of cloudpickle that is incompatible with tensorflow-probability
# 0.7.0.
'gym < 0.16.0',
'imageio',
'intervaltree >= 2.1.0',
'joblib >= 0.12',
'librosa >= 0.6.2',
'matplotlib >= 1.5.3',
'mido == 1.2.6',
'mir_eval >= 0.4',
'numpy >= 1.14.6', # 1.14.6 is required for colab compatibility.
'pandas >= 0.18.1',
'pretty_midi >= 0.2.6',
'protobuf >= 3.6.1',
'pygtrie >= 2.3',
'python-rtmidi >= 1.1, < 1.2', # 1.2 breaks us
'scikit-image',
'scipy >= 0.18.1',
'six >= 1.12.0',
'sk-video',
# Keep Sonnet < 2.0.0 because that requires TF2.
# For now, restrict to < 1.36 because that requires tensorflow-probability
# 0.8.0, which causes problems with tensor2tensor.
'dm-sonnet < 1.36.0', # Sonnet 2 requires TF2.
'sox >= 1.3.7',
'tensorflow >= 1.15.0, < 2.0.0', # Magenta is not yet TF2 compatible.
'tensorflow-datasets >= 1.0.2',
# Pinned to be compatible with tensor2tensor requirements.
'tensorflow-probability == 0.7.0',
'tensor2tensor >= 1.13.4',
'wheel',
'futures;python_version=="2.7"',
'apache-beam[gcp] >= 2.14.0, < 2.19.0', # Temporary fix for 'typing' issue
# Temporary fix for:
# https://issues.apache.org/jira/projects/AVRO/issues/AVRO-2737?filter=allopenissues
'avro-python3 !=1.9.2',
]
EXTRAS_REQUIRE = {
'onsets_frames_realtime': [
'pyaudio',
'colorama',
'tflite',
],
}
# pylint:disable=line-too-long
CONSOLE_SCRIPTS = [
'magenta.interfaces.midi.magenta_midi',
'magenta.interfaces.midi.midi_clock',
'magenta.models.arbitrary_image_stylization.arbitrary_image_stylization_evaluate',
'magenta.models.arbitrary_image_stylization.arbitrary_image_stylization_train',
'magenta.models.arbitrary_image_stylization.arbitrary_image_stylization_with_weights',
'magenta.models.arbitrary_image_stylization.arbitrary_image_stylization_distill_mobilenet',
'magenta.models.drums_rnn.drums_rnn_create_dataset',
'magenta.models.drums_rnn.drums_rnn_generate',
'magenta.models.drums_rnn.drums_rnn_train',
'magenta.models.image_stylization.image_stylization_create_dataset',
'magenta.models.image_stylization.image_stylization_evaluate',
'magenta.models.image_stylization.image_stylization_finetune',
'magenta.models.image_stylization.image_stylization_train',
'magenta.models.image_stylization.image_stylization_transform',
'magenta.models.improv_rnn.improv_rnn_create_dataset',
'magenta.models.improv_rnn.improv_rnn_generate',
'magenta.models.improv_rnn.improv_rnn_train',
'magenta.models.gansynth.gansynth_train',
'magenta.models.gansynth.gansynth_generate',
'magenta.models.melody_rnn.melody_rnn_create_dataset',
'magenta.models.melody_rnn.melody_rnn_generate',
'magenta.models.melody_rnn.melody_rnn_train',
'magenta.models.music_vae.music_vae_generate',
'magenta.models.music_vae.music_vae_train',
'magenta.models.nsynth.wavenet.nsynth_generate',
'magenta.models.nsynth.wavenet.nsynth_save_embeddings',
'magenta.models.onsets_frames_transcription.onsets_frames_transcription_create_dataset',
'magenta.models.onsets_frames_transcription.onsets_frames_transcription_create_dataset_maps',
'magenta.models.onsets_frames_transcription.onsets_frames_transcription_create_tfrecords',
'magenta.models.onsets_frames_transcription.onsets_frames_transcription_infer',
'magenta.models.onsets_frames_transcription.onsets_frames_transcription_train',
'magenta.models.onsets_frames_transcription.onsets_frames_transcription_transcribe',
'magenta.models.onsets_frames_transcription.realtime.onsets_frames_transcription_realtime',
'magenta.models.performance_rnn.performance_rnn_create_dataset',
'magenta.models.performance_rnn.performance_rnn_generate',
'magenta.models.performance_rnn.performance_rnn_train',
'magenta.models.pianoroll_rnn_nade.pianoroll_rnn_nade_create_dataset',
'magenta.models.pianoroll_rnn_nade.pianoroll_rnn_nade_generate',
'magenta.models.pianoroll_rnn_nade.pianoroll_rnn_nade_train',
'magenta.models.polyphony_rnn.polyphony_rnn_create_dataset',
'magenta.models.polyphony_rnn.polyphony_rnn_generate',
'magenta.models.polyphony_rnn.polyphony_rnn_train',
'magenta.models.rl_tuner.rl_tuner_train',
'magenta.models.sketch_rnn.sketch_rnn_train',
'magenta.scripts.convert_dir_to_note_sequences',
'magenta.tensor2tensor.t2t_datagen',
'magenta.tensor2tensor.t2t_decoder',
'magenta.tensor2tensor.t2t_trainer',
]
# pylint:enable=line-too-long
setup(
name='magenta',
version=__version__, # pylint: disable=undefined-variable
description='Use machine learning to create art and music',
long_description='',
url='https://magenta.tensorflow.org/',
author='Google Inc.',
author_email='[email protected]',
license='Apache 2',
# PyPI package information.
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Intended Audience :: Education',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Topic :: Scientific/Engineering :: Mathematics',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Software Development :: Libraries',
],
keywords='tensorflow machine learning magenta music art',
packages=find_packages(),
install_requires=REQUIRED_PACKAGES,
extras_require=EXTRAS_REQUIRE,
entry_points={
'console_scripts': ['%s = %s:console_entry_point' % (n, p) for n, p in
((s.split('.')[-1], s) for s in CONSOLE_SCRIPTS)],
},
include_package_data=True,
package_data={
'magenta': ['models/image_stylization/evaluation_images/*.jpg'],
},
setup_requires=['pytest-runner', 'pytest-pylint'],
tests_require=[
'pytest >= 5.2.0',
'pytest-xdist < 1.30.0', # 1.30 has problems working with pylint plugin
'pylint < 2.0.0;python_version<"3"',
'pylint >= 2.4.2;python_version>="3"',
],
)