forked from tinytag/tinytag
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
executable file
·61 lines (57 loc) · 2.17 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
from os.path import join
from setuptools import setup, find_packages
import sys
import os
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
def get_version():
with open(join('tinytag', '__init__.py')) as f:
for line in f:
if line.startswith('__version__ ='):
return line.split('=')[1].strip().strip('"\'')
long_description = None
if 'upload' in sys.argv or 'register' in sys.argv:
readmemd = "\n" + "\n".join([read('README.md')])
print("converting markdown to reStucturedText for upload to pypi.")
from urllib.request import urlopen
from urllib.parse import quote
import json
import codecs
url = 'http://johnmacfarlane.net/cgi-bin/trypandoc?text=%s&from=markdown&to=rst'
urlhandler = urlopen(url % quote(readmemd))
result = json.loads(codecs.decode(urlhandler.read(), 'utf-8'))
long_description = result['result']
else:
long_description = "\n" + "\n".join([read('README.md')])
setup(
name='tinytag',
version=get_version(),
description='Read music meta data and length of MP3, OGG, OPUS, MP4, M4A, FLAC, WMA and Wave files',
long_description=long_description,
author='Tom Wallroth',
author_email='[email protected]',
url='https://github.com/devsnd/tinytag/',
license='GPLv3',
packages=find_packages(),
install_requires=[],
classifiers=[
'Programming Language :: Python',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
'Development Status :: 4 - Beta',
'Environment :: Web Environment',
'Intended Audience :: Developers',
'Operating System :: OS Independent',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Multimedia',
'Topic :: Multimedia :: Sound/Audio',
],
zip_safe=False,
tests_require=["nose"],
)