forked from zackees/template-docker-fastapi-site
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
39 lines (31 loc) · 1.02 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
"""
Setup file.
"""
import os
import re
import setuptools
URL = ""
KEYWORDS = ""
HERE = os.path.dirname(os.path.abspath(__file__))
def get_readme() -> str:
"""Get the contents of the README file."""
readme = os.path.join(HERE, "README.md")
with open(readme, encoding="utf-8", mode="r") as readme_file:
readme_lines = readme_file.readlines()
for i, line in enumerate(readme_lines):
if "../../" in line:
# Transform the relative links to absolute links
output_string = re.sub(r"(\.\./\.\.)", f"{URL}", line, count=1)
output_string = re.sub(r"(\.\./\.\.)", f"{URL}", output_string)
readme_lines[i] = output_string
return "".join(readme_lines)
if __name__ == "__main__":
setuptools.setup(
maintainer="Zachary Vorhies",
keywords=KEYWORDS,
long_description=get_readme(),
long_description_content_type="text/markdown",
url=URL,
package_data={"": ["assets/example.txt"]},
include_package_data=True,
)