-
Notifications
You must be signed in to change notification settings - Fork 20
/
setup.py
executable file
·67 lines (57 loc) · 1.87 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
#!/usr/bin/env python
"""
Setupfile for pdftools.
:author: Stefan Lehmann <[email protected]>
:license: MIT, see license file or https://opensource.org/licenses/MIT
:created on 2018-04-14 20:40:27
:last modified by: Stefan Lehmann
:last modified time: 2018-04-14 21:03:58
"""
import ast
import io
import re
import os
from setuptools import setup, find_packages
def read(*names, **kwargs):
try:
with io.open(
os.path.join(os.path.dirname(__file__), *names),
encoding=kwargs.get("encoding", "utf8")
) as fp:
return fp.read()
except IOError:
return ''
def extract_version():
"""Extract the version from the package."""
# Regular expression for the version
_version_re = re.compile(r"__version__\s+=\s+(.*)")
with open("pdftools/__init__.py", "r") as f:
content = f.read()
version_match = _version_re.search(content)
version = str(ast.literal_eval(version_match.group(1)))
return version
setup(
name="pdftools",
version=extract_version(),
packages=find_packages(),
entry_points={"console_scripts": ["pdftools=pdftools._cli:main"]},
url="https://github.com/stlehmann/pdftools",
license="MIT",
author="Stefan Lehmann",
author_email="[email protected]",
description="A collection of convenience scripts for PDF manipulation, based on the PyPdf2 package",
long_description=read("README.md"),
long_description_content_type='text/markdown',
install_requires=["PyPdf2"],
maintainer="Stefan Lehmann",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3 :: Only",
"Topic :: Office/Business",
],
zip_safe=True,
)