python_test_project/setup.py

47 lines
1.3 KiB
Python
Raw Normal View History

2024-11-11 06:12:40 -08:00
"""Python setup.py for python_test_project package"""
2024-11-11 06:11:21 -08:00
import io
import os
from setuptools import find_packages, setup
def read(*paths, **kwargs):
"""Read the contents of a text file safely.
2024-11-11 06:12:40 -08:00
>>> read("python_test_project", "VERSION")
2024-11-11 06:11:21 -08:00
'0.1.0'
>>> read("README.md")
...
"""
content = ""
with io.open(
os.path.join(os.path.dirname(__file__), *paths),
encoding=kwargs.get("encoding", "utf8"),
) as open_file:
content = open_file.read().strip()
return content
def read_requirements(path):
return [
line.strip()
for line in read(path).split("\n")
if not line.startswith(('"', "#", "-", "git+"))
]
setup(
2024-11-11 06:12:40 -08:00
name="python_test_project",
version=read("python_test_project", "VERSION"),
description="Awesome python_test_project created by Projects",
url="https://git.disi.dev/Projects/python_test_project/",
2024-11-11 06:11:21 -08:00
long_description=read("README.md"),
long_description_content_type="text/markdown",
2024-11-11 06:12:40 -08:00
author="Projects",
2024-11-11 06:11:21 -08:00
packages=find_packages(exclude=["tests", ".gitea"]),
install_requires=read_requirements("requirements.txt"),
entry_points={
2024-11-11 06:12:40 -08:00
"console_scripts": ["python_test_project = python_test_project.__main__:main"]
2024-11-11 06:11:21 -08:00
},
extras_require={"test": read_requirements("requirements-test.txt")},
)