-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·65 lines (53 loc) · 1.67 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
#!/usr/bin/env python3
from re import match
from pathlib import Path
from subprocess import Popen
from sys import argv
from setuptools import setup, find_packages
HERE = Path(Path(__file__).parent)
META = {}
PKGDATA = {'': ['LICENSE', 'README.md']}
if argv[-1] == 'publish':
MAKE = ('python', 'setup.py', 'sdist', 'bdist_wheel')
UP = ('twine', 'upload', 'dist/*')
with Popen(MAKE) as m:
m.wait()
with Popen(UP) as u:
u.wait()
exit(0)
with (HERE / 'pnglatex' / '__init__.py').open() as init_file:
for line in init_file:
matched = match(r"^__(.+)__\s+=\s+'(.+)'$", line.rstrip())
if not matched:
continue
name = matched.group(1)
if name == 'title':
name = 'name'
META[name] = matched.group(2)
with (HERE / 'README.md').open() as r:
README = r.read()
setup(
packages=find_packages(),
entry_points={
'console_scripts': ['pnglatex = pnglatex.pnglatex:main']
},
package_data=PKGDATA,
include_package_data=True,
long_description=README,
classifiers=[
'License :: OSI Approved :: '
'GNU General Public License v3 or later (GPLv3+)',
'Natural Language :: English',
'Operating System :: POSIX',
'Programming Language :: Python :: 3',
'Topic :: Text Processing :: Markup :: LaTeX',
'Topic :: Utilities',
'Topic :: Multimedia :: Graphics :: Graphics Conversion',
'Environment :: Console',
'Intended Audience :: Developers',
'Intended Audience :: End Users/Desktop',
'Intended Audience :: Education',
'Development Status :: 5 - Production/Stable'
],
**META
)