Skip to content

Commit 7fac861

Browse files
committed
migrated to use setup.cfg instead of setup.py (thanks to scivision)
1 parent 4689078 commit 7fac861

File tree

2 files changed

+83
-59
lines changed

2 files changed

+83
-59
lines changed

Diff for: setup.cfg

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
[metadata]
2+
name = tinytag
3+
author = Tom Wallroth
4+
author_email = [email protected]
5+
url = https://github.com/devsnd/tinytag
6+
description = Read music meta data and length of MP3, OGG, OPUS, MP4, M4A, FLAC, WMA and Wave files
7+
keywords =
8+
metadata
9+
music
10+
classifiers =
11+
Programming Language :: Python
12+
Programming Language :: Python :: 2.7
13+
Programming Language :: Python :: 3
14+
Programming Language :: Python :: 3.3
15+
Programming Language :: Python :: 3.4
16+
Programming Language :: Python :: 3.5
17+
Programming Language :: Python :: 3.6
18+
Programming Language :: Python :: 3.7
19+
License :: OSI Approved :: MIT License
20+
Development Status :: 5 - Production/Stable
21+
Environment :: Web Environment
22+
Intended Audience :: Developers
23+
Operating System :: OS Independent
24+
Topic :: Internet :: WWW/HTTP
25+
Topic :: Multimedia
26+
Topic :: Multimedia :: Sound/Audio
27+
Topic :: Multimedia :: Sound/Audio :: Analysis
28+
license_file = LICENSE
29+
long_description = file: README.md
30+
long_description_content_type = text/markdown
31+
32+
[options]
33+
python_requires = >= 2.7
34+
setup_requires =
35+
setuptools >= 38.6
36+
pip >= 10
37+
twine >= 1.11
38+
include_package_data = True
39+
packages = find:
40+
install_requires =
41+
42+
[options.extras_require]
43+
tests =
44+
pytest
45+
pytest-cov
46+
coveralls
47+
flake8
48+
49+
[options.entry_points]
50+
console_scripts =
51+
52+
[flake8]
53+
max-line-length = 132
54+
exclude = .git,__pycache__,.eggs/,doc/,docs/,build/,dist/,archive/,src/
55+
ignore = E501
56+
57+
[coverage:run]
58+
cover_pylib = false
59+
omit =
60+
/home/travis/virtualenv/*
61+
*/site-packages/*
62+
*/bin/*
63+
*/src/*
64+
65+
[coverage:report]
66+
exclude_lines =
67+
pragma: no cover
68+
def __repr__
69+
except RuntimeError
70+
except NotImplementedError
71+
except ImportError
72+
except FileNotFoundError
73+
except CalledProcessError
74+
logging.warning
75+
logging.error
76+
logging.critical
77+
if __name__ == .__main__.:

Diff for: setup.py

+6-59
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,12 @@
1+
#!/usr/bin/env python
12
from os.path import join
2-
from setuptools import setup, find_packages
3-
import sys
4-
import os
3+
from setuptools import setup
54

6-
def read(fname):
7-
with open(os.path.join(os.path.dirname(__file__), fname)) as f:
8-
return f.read()
95

106
def get_version():
11-
with open(join('tinytag', '__init__.py')) as f:
12-
for line in f:
13-
if line.startswith('__version__ ='):
14-
return line.split('=')[1].strip().strip('"\'')
7+
with open(join("tinytag", "__init__.py")) as f:
8+
version_line = next(line for line in f if line.startswith("__version__ ="))
9+
return version_line.split("=")[1].strip().strip("\"'")
1510

16-
long_description = None
17-
if 'upload' in sys.argv or 'register' in sys.argv:
18-
readmemd = "\n" + "\n".join([read('README.md')])
19-
print("converting markdown to reStucturedText for upload to pypi.")
20-
from urllib.request import urlopen
21-
from urllib.parse import quote
22-
import json
23-
import codecs
24-
url = 'http://pandoc.org/cgi-bin/trypandoc?from=markdown&to=rst&text=%s'
25-
urlhandler = urlopen(url % quote(readmemd))
26-
result = json.loads(codecs.decode(urlhandler.read(), 'utf-8'))
27-
long_description = result['html']
28-
else:
29-
long_description = "\n" + "\n".join([read('README.md')])
3011

31-
setup(
32-
name='tinytag',
33-
version=get_version(),
34-
description='Read music meta data and length of MP3, OGG, OPUS, MP4, M4A, FLAC, WMA and Wave files',
35-
long_description=long_description,
36-
long_description_content_type='text/markdown',
37-
author='Tom Wallroth',
38-
author_email='[email protected]',
39-
url='https://github.com/devsnd/tinytag/',
40-
license='MIT',
41-
packages=find_packages(),
42-
install_requires=[],
43-
classifiers=[
44-
'Programming Language :: Python',
45-
'Programming Language :: Python :: 2.6',
46-
'Programming Language :: Python :: 2.7',
47-
'Programming Language :: Python :: 3',
48-
'Programming Language :: Python :: 3.2',
49-
'Programming Language :: Python :: 3.3',
50-
'Programming Language :: Python :: 3.4',
51-
'Programming Language :: Python :: 3.5',
52-
'Programming Language :: Python :: 3.6',
53-
'License :: OSI Approved :: MIT License',
54-
'Development Status :: 5 - Production/Stable',
55-
'Environment :: Web Environment',
56-
'Intended Audience :: Developers',
57-
'Operating System :: OS Independent',
58-
'Topic :: Internet :: WWW/HTTP',
59-
'Topic :: Multimedia',
60-
'Topic :: Multimedia :: Sound/Audio',
61-
'Topic :: Multimedia :: Sound/Audio :: Analysis',
62-
],
63-
zip_safe=False,
64-
tests_require=["nose"],
65-
)
12+
setup(version=get_version())

0 commit comments

Comments
 (0)