-
Notifications
You must be signed in to change notification settings - Fork 126
/
setup.py
92 lines (82 loc) · 3.2 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/usr/bin/env python3
"""
The setup script used to package the se library and executables.
To build the project, enter the project's root directory and do:
python3 setup.py bdist_wheel
After the project has been built, you can install it locally:
pip3 install dist/standardebooks-*.whl
To upload the build to pypi, twine is required:
pip3 install twine
"""
import re
from pathlib import Path
from setuptools import find_packages, setup
# Get the long description from the README file
def _get_file_contents(file_path: Path) -> str:
"""
Helper function to get README contents
"""
with open(file_path, encoding="utf-8") as file:
return file.read()
def _get_version() -> str:
"""
Helper function to get VERSION from source code
"""
source_path = Path("se/__init__.py")
contents = _get_file_contents(source_path)
match = re.search(r'^VERSION = "([^"]+)"$', contents, flags=re.MULTILINE)
if not match:
raise RuntimeError(f"VERSION not found in {source_path}")
return match.group(1)
setup(
version=_get_version(),
name="standardebooks",
description="The toolset used to produce Standard Ebooks epub ebooks.",
long_description=_get_file_contents(Path(__file__).resolve().parent / "README.md"),
long_description_content_type="text/markdown",
url="https://standardebooks.org",
author="Standard Ebooks",
author_email="[email protected]",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Topic :: Software Development :: Build Tools",
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
"Programming Language :: Python :: 3"
],
keywords="ebooks epub",
packages=find_packages(),
python_requires=">=3.6.*", # The latest version installed by default on Ubuntu 18.04 is 3.6.9
install_requires=[
"cairosvg==2.5.2",
"chardet==5.0.0", # Must stay at this version until the server can use Python >= 3.7
"cssselect==1.1.0", # Must stay at this version until the server can use Python >= 3.7
"cssutils==2.3.0", # Must stay at this version until the server can use Python >= 3.7
"ftfy==6.0.3", # Must stay at this version until the server can use Python >= 3.7
"gitpython==3.1.11", # Must stay at this version until the server can use Python >= 3.7
"importlib_resources==1.0.2",
"lxml==4.9.2",
"natsort==7.1.1", # Can't update until we update mypy to 900+
"pillow==8.4.0", # Must stay at this version until the server can use Python >= 3.7
"psutil==5.9.4",
"pyphen==0.11.0", # Must stay at this version until the server can use Python >= 3.7
"regex==2021.08.28",
"requests==2.27.1", # Must stay at this version until the server can use Python >= 3.7
"rich==12.6.0", # Must stay at this version until the server can use Python >= 3.7
"roman==3.3.0",
"selenium==3.141.0", # Must stay at this version until the server can use Python >= 3.7
"smartypants==2.0.1",
"tinycss2==1.1.1", # Must stay at this version until the server can use Python >= 3.7
"titlecase==2.3", # Must stay at this version until the server can use Python >= 3.7
"unidecode==1.2.0"
],
include_package_data=True,
entry_points={
"console_scripts": [
"se = se.main:main",
],
},
project_urls={
"Source": "https://standardebooks.org/tools",
}
)