forked from zackees/create-python-cmd
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
32 lines (25 loc) · 1012 Bytes
/
setup.py
File metadata and controls
32 lines (25 loc) · 1012 Bytes
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
import os
import re
import setuptools
URL = "https://github.com/zackees/create-python-cmd"
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",
long_description=get_readme(),
long_description_content_type="text/markdown",
url=URL,
include_package_data=True,
)