-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
76 lines (65 loc) · 2.49 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
import sys
from os.path import dirname, join
from setuptools import setup
if sys.version_info.major < 3:
raise NotImplementedError('Sorry, only Python 3 and above is supported.')
# additional metadata, requirements
keywords = ('file files rename renamer')
proj_name = 'prn'
# https://www.python.org/dev/peps/pep-0508/#environment-markers
install_requires = (
'colorama; os_name == "nt" and platform_version < "10.0.10586" ',
'win_unicode_console; os_name == "nt" and python_version < "3.6" ',
)
tests_require = ('pyflakes', 'readme_renderer'),
extras_require = dict(
#~ foo=('foo',),
)
def get_version(filename, version='1.00'):
''' Read version as text to avoid machinations at import time. '''
with open(filename) as infile:
for line in infile:
if line.startswith('__version__'):
try:
version = line.split("'")[1]
except IndexError:
pass
break
return version
def slurp(filename):
try:
with open(join(dirname(__file__), filename), encoding='utf8') as infile:
return infile.read()
except FileNotFoundError:
pass # needed at upload time, not install time
setup(
name = proj_name,
description = 'A powerful script to rename files. '
'Better, stronger, faster.',
author_email = '[email protected]',
author = 'Mike Miller',
keywords = keywords,
license = 'LGPL 3',
long_description = slurp('readme.rst'),
url = 'https://github.com/mixmastamyk/prename',
version = get_version(proj_name),
extras_require = extras_require,
install_requires = install_requires,
python_requires = '>=3.6',
setup_requires = install_requires,
tests_require = tests_require,
scripts = (proj_name,),
classifiers = [
'Development Status :: 4 - Beta',
'Environment :: Console',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Topic :: Software Development :: Libraries',
'Topic :: Terminals',
'Topic :: System :: Filesystems',
],
)