-
Notifications
You must be signed in to change notification settings - Fork 1.8k
/
setup.py
executable file
·206 lines (189 loc) · 6.46 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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2016, Adrian Sampson.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
from __future__ import division, absolute_import, print_function
import os
import sys
import subprocess
import shutil
from setuptools import setup
def _read(fn):
path = os.path.join(os.path.dirname(__file__), fn)
return open(path).read()
def build_manpages():
# Go into the docs directory and build the manpage.
docdir = os.path.join(os.path.dirname(__file__), 'docs')
curdir = os.getcwd()
os.chdir(docdir)
try:
subprocess.check_call(['make', 'man'])
except OSError:
print("Could not build manpages (make man failed)!", file=sys.stderr)
return
finally:
os.chdir(curdir)
# Copy resulting manpages.
mandir = os.path.join(os.path.dirname(__file__), 'man')
if os.path.exists(mandir):
shutil.rmtree(mandir)
shutil.copytree(os.path.join(docdir, '_build', 'man'), mandir)
# Build manpages if we're making a source distribution tarball.
if 'sdist' in sys.argv:
build_manpages()
setup(
name='beets',
version='1.5.0',
description='music tagger and library organizer',
author='Adrian Sampson',
author_email='[email protected]',
url='https://beets.io/',
license='MIT',
platforms='ALL',
long_description=_read('README.rst'),
test_suite='test.testall.suite',
zip_safe=False,
include_package_data=True, # Install plugin resources.
packages=[
'beets',
'beets.ui',
'beets.autotag',
'beets.util',
'beets.dbcore',
'beetsplug',
'beetsplug.bpd',
'beetsplug.web',
'beetsplug.lastgenre',
'beetsplug.metasync',
],
entry_points={
'console_scripts': [
'beet = beets.ui:main',
],
},
install_requires=[
'six>=1.9',
'unidecode',
'musicbrainzngs>=0.4',
'pyyaml',
'mediafile>=0.2.0',
'confuse>=1.0.0',
] + [
# Avoid a version of munkres incompatible with Python 3.
'munkres~=1.0.0' if sys.version_info < (3, 5, 0) else
'munkres!=1.1.0,!=1.1.1' if sys.version_info < (3, 6, 0) else
'munkres>=1.0.0',
] + (
# Use the backport of Python 3.4's `enum` module.
['enum34>=1.0.4'] if sys.version_info < (3, 4, 0) else []
) + (
# Pin a Python 2-compatible version of Jellyfish.
['jellyfish==0.6.0'] if sys.version_info < (3, 4, 0) else ['jellyfish']
) + (
# Support for ANSI console colors on Windows.
['colorama'] if (sys.platform == 'win32') else []
),
extras_require={
'test': [
'beautifulsoup4',
'coverage',
'flask',
'mock',
'pylast',
'pytest',
'python-mpd2',
'pyxdg',
'responses>=0.3.0',
'requests_oauthlib',
'reflink',
] + (
# Tests for the thumbnails plugin need pathlib on Python 2 too.
['pathlib'] if (sys.version_info < (3, 4, 0)) else []
) + [
'rarfile<4' if sys.version_info < (3, 6, 0) else 'rarfile',
] + [
'discogs-client' if (sys.version_info < (3, 0, 0))
else 'python3-discogs-client'
] + (
['py7zr'] if (sys.version_info > (3, 5, 0)) else []
),
'lint': [
'flake8',
'flake8-coding',
'flake8-docstrings',
'flake8-future-import',
'pep8-naming',
],
# Plugin (optional) dependencies:
'absubmit': ['requests'],
'fetchart': ['requests', 'Pillow'],
'embedart': ['Pillow'],
'embyupdate': ['requests'],
'chroma': ['pyacoustid'],
'gmusic': ['gmusicapi'],
'discogs': (
['discogs-client' if (sys.version_info < (3, 0, 0))
else 'python3-discogs-client']
),
'beatport': ['requests-oauthlib>=0.6.1'],
'kodiupdate': ['requests'],
'lastgenre': ['pylast'],
'lastimport': ['pylast'],
'lyrics': ['requests', 'beautifulsoup4', 'langdetect'],
'mpdstats': ['python-mpd2>=0.4.2'],
'plexupdate': ['requests'],
'web': ['flask', 'flask-cors'],
'import': (
['rarfile<4' if (sys.version_info < (3, 6, 0)) else 'rarfile']
),
'thumbnails': ['pyxdg', 'Pillow'] +
(['pathlib'] if (sys.version_info < (3, 4, 0)) else []),
'metasync': ['dbus-python'],
'sonosupdate': ['soco'],
'scrub': ['mutagen>=1.33'],
'bpd': ['PyGObject'],
'replaygain': ['PyGObject'],
'reflink': ['reflink'],
},
# Non-Python/non-PyPI plugin dependencies:
# chroma: chromaprint or fpcalc
# convert: ffmpeg
# badfiles: mp3val and flac
# bpd: python-gi and GStreamer 1.0+
# embedart: ImageMagick
# absubmit: extractor binary from https://acousticbrainz.org/download
# keyfinder: KeyFinder
# replaygain: python-gi and GStreamer 1.0+
# or mp3gain/aacgain
# or Python Audio Tools
# or ffmpeg
# ipfs: go-ipfs
classifiers=[
'Topic :: Multimedia :: Sound/Audio',
'Topic :: Multimedia :: Sound/Audio :: Players :: MP3',
'License :: OSI Approved :: MIT License',
'Environment :: Console',
'Environment :: Web Environment',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: Implementation :: CPython',
],
)