-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
78 lines (67 loc) · 2.51 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
#! /usr/bin/env python3
#pip install --user -e .
#py.test --cov stpl --cov-report term-missing
#sudo python setup.py bdist_wheel
#twine upload ./dist/stpl*.whl
from setuptools import setup
import os
#https://github.com/pypa/packaging-problems/issues/72
from glob import glob
import os
def find_dirs(dir_name):
for dir, dirs, files in os.walk('.'):
if dir_name in dirs:
yield os.path.relpath(os.path.join(dir, dir_name))
# Find all of the man/info pages
data_files = []
man_sections = {}
for dir in find_dirs('man'):
for file in os.listdir(dir):
section = file.split('.')[-1]
man_sections[section] = man_sections.get(section, []) + [os.path.join(dir, file)]
for section in man_sections:
data_files.append(('share/man/man'+section, man_sections[section]))
info_pages = {}
for dir in find_dirs('info'):
for file in glob(os.path.join(dir, '*.info')):
info_pages[dir] = info_pages.get(dir, []) + [file]
for dir in info_pages:
data_files.append(('share/info', info_pages[dir]))
__version__ = [x.split()[2].strip("'") for x in open(
'./stpl/stpl.py').readlines() if x.startswith('__version__')][0]
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname),encoding='utf-8').read()
setup(name = 'stpl',
version = __version__,
description = 'stpl - expand bottle SimpleTemplate',
license = 'MIT',
author = 'Roland Puntaier',
keywords=['Duplicate, File'],
author_email = '[email protected]',
url = 'https://github.com/rpuntaie/stpl',
classifiers = [
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Operating System :: OS Independent',
'Operating System :: POSIX',
'Programming Language :: Python',
'Intended Audience :: End Users/Desktop',
'Intended Audience :: Information Technology',
'Topic :: Utilities',
],
install_requires = [],
extras_require = {'develop': ['mock','pytest','pytest-coverage']},
long_description = read('README.rst'),
##to check with ``restview --pypi-strict long_description.rst``
#with open('long_description.rst','w',encoding='utf-8') as f:
# f.write(long_description)
packages=['stpl'],
include_package_data=True,
exclude_package_data={'': ['*.pyc']},
data_files=data_files,
zip_safe=False,
tests_require=[],
entry_points={'console_scripts': ['stpl=stpl:main']}
)