This repository has been archived by the owner on Oct 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
66 lines (54 loc) · 2.03 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
import re
import setuptools
repo_url = "https://github.com/loic-simon/lg-rez"
version = ""
with open("lgrez/__init__.py") as f:
version = re.search(r"""^__version__\s*=\s*['"](.*?)['"]""",
f.read(), re.MULTILINE).group(1)
assert version, "__version__ not found in __init__.py"
def absolute_links(string, base):
"""Replace all relative Markdown links by absolute links"""
base = base.rstrip("/")
return re.sub(
r"\[(.+?)\]\(([^:]+?)\)", # Every [text](link) without ":" in link
f"[\\1]({base}/\\2)", # Replace link by base/link
string
)
with open("README.md", "r", encoding="utf-8") as fh:
readme = fh.read()
version_blob_url = f"{repo_url}/blob/{version}"
# Github blob URL for tag <version>
long_description = absolute_links(readme, version_blob_url)
# long_description is README.md contents with relative links to project
# files/folders converted into links to files on GitHub blob, so they
# can be clicked on PyPI.
with open("requirements.txt", "r", encoding="utf-8") as fh:
requirements = fh.readlines()
setuptools.setup(
name="lg-rez",
version=version,
author="Loïc Simon, Tom Lacoma",
author_email="loic.simon@espci.org, tom.lacoma@espci.org",
description="Discord bot for organizing Werewolf RP games ESPCI-style",
long_description=long_description,
long_description_content_type="text/markdown",
url=repo_url,
packages=setuptools.find_packages(),
classifiers=[
"Development Status :: 5 - Production/Stable",
"Framework :: AsyncIO",
"Intended Audience :: Developers",
"Natural Language :: French",
"Programming Language :: Python :: 3.10",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Topic :: Games/Entertainment :: Role-Playing",
"Topic :: Internet",
],
install_requires=requirements,
python_requires=">=3.10",
package_data={
"lgrez": ["server_structure.json"],
},
include_package_data=True,
)