-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup.py
156 lines (139 loc) · 4.52 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
import codecs
import os
import re
import setuptools
here = os.path.abspath(os.path.dirname(__file__))
def read(*parts):
# intentionally *not* adding an encoding option to open
return codecs.open(os.path.join(here, *parts), "r").read()
def find_meta(*meta_file_parts, meta_key):
"""
Extract __*meta*__ from meta_file
"""
meta_file = read(*meta_file_parts)
meta_match = re.search(
r"^__{}__ = ['\"]([^'\"]*)['\"]".format(meta_key), meta_file, re.M
)
if meta_match:
return meta_match.group(1)
raise RuntimeError("Unable to find __{}__ string.".format(meta_key))
##############################################################################
# PACKAGE METADATA #
##############################################################################
META_PATH = ["pelican", "plugins", "seafoam", "constants.py"]
NAME = find_meta(*META_PATH, meta_key="title").lower()
VERSION = find_meta(*META_PATH, meta_key="version")
SHORT_DESC = find_meta(*META_PATH, meta_key="description")
LONG_DESC = read("README.rst")
AUTHOR = find_meta(*META_PATH, meta_key="author")
AUTHOR_EMAIL = find_meta(*META_PATH, meta_key="email")
URL = find_meta(*META_PATH, meta_key="url")
LICENSE = find_meta(*META_PATH, meta_key="license")
PACKAGES = setuptools.find_namespace_packages(
exclude=(
"vendor_src",
"test",
"docs",
"css_src",
)
)
INSTALL_REQUIRES = [
"pelican",
"pelican-image-process >= 2.1.1",
"pelican-jinja-filters >= 2.1.0",
"semantic_version",
"beautifulsoup4",
]
EXTRA_REQUIRES = {
"lxml": [
"lxml",
],
"build": [
# "pip-tools",
"minchin.releaser >= 0.8.2",
# less, installed via npm # npm install less -g
],
"docs": [
# 'sphinx >= 1.4', # theme requires at least 1.4
# 'cloud_sptheme >= 1.8',
# 'releases',
# 'Babel >= 1.3, != 2.0', # 2.0 breaks on Windows
],
"test": [
# 'green >= 1.9.4', # v2 works
# 'coverage',
# 'isort',
# 'pydocstyle',
# 'pycodestyle',
# 'check-manifest'
"markdown",
],
"dev": [
"markdown",
"invoke",
],
}
# full list of Classifiers at
# https://pypi.python.org/pypi?%3Aaction=list_classifiers
CLASSIFIERS = [
# having an unknown classifier should keep PyPI from accepting the
# package as an upload
# 'Private :: Do Not Upload',
# 'Development Status :: 1 - Planning',
# 'Development Status :: 2 - Pre-Alpha',
# 'Development Status :: 3 - Alpha',
# "Development Status :: 4 - Beta",
'Development Status :: 5 - Production/Stable',
# 'Development Status :: 6 - Mature',
# 'Development Status :: 7 - Inactive',
"Environment :: Console",
"Framework :: Pelican :: Plugins",
"Framework :: Pelican :: Themes",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3 :: Only",
"Natural Language :: English",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Topic :: Software Development :: Libraries :: Python Modules",
]
##############################################################################
if LICENSE in ["MIT License"]:
CLASSIFIERS += ["License :: OSI Approved :: {}".format(LICENSE)]
# add 'all' key to EXTRA_REQUIRES
all_requires = []
for k, v in EXTRA_REQUIRES.items():
all_requires.extend(v)
EXTRA_REQUIRES["all"] = all_requires
setuptools.setup(
name=NAME,
version=VERSION,
url=URL,
project_urls={
"Bug Tracker": "https://github.com/MinchinWeb/seafoam/issues",
"Changelog": "https://github.com/MinchinWeb/seafoam/blob/master/docs/changelog.rst",
},
license=LICENSE,
author=AUTHOR,
author_email=AUTHOR_EMAIL,
description=SHORT_DESC,
long_description=LONG_DESC,
long_description_content_type="text/x-rst",
packages=PACKAGES,
package_data={"": ["README.rst", "docs/changelog.rst", "LICENSE.txt"]},
include_package_data=True,
install_requires=INSTALL_REQUIRES,
extras_require=EXTRA_REQUIRES,
platforms="any",
classifiers=CLASSIFIERS,
# namespace_packages=[
# # "pelican",
# # "pelican.plugins",
# "pelican.plugins.seafoam",
# ],
# zip_save=False, # use wheel instead
)