mirror of
https://github.com/PaiGramTeam/SIMNet.git
synced 2024-11-16 03:55:28 +00:00
✨ Add setup
This commit is contained in:
parent
610686fa1b
commit
fcc1f2489b
50
setup.py
Normal file
50
setup.py
Normal file
@ -0,0 +1,50 @@
|
||||
"""Run setuptools."""
|
||||
from pathlib import Path
|
||||
|
||||
from setuptools import find_packages, setup
|
||||
|
||||
from simnet.version import __version__
|
||||
|
||||
|
||||
def get_requirements():
|
||||
"""Build the requirements list for this project"""
|
||||
requirements_list = []
|
||||
|
||||
with Path("requirements.txt").open() as reqs:
|
||||
for install in reqs:
|
||||
if install.startswith("#"):
|
||||
continue
|
||||
requirements_list.append(install.strip())
|
||||
|
||||
return requirements_list
|
||||
|
||||
|
||||
def get_setup_kwargs():
|
||||
"""Builds a dictionary of kwargs for the setup function"""
|
||||
requirements = get_requirements()
|
||||
|
||||
kwargs = dict(
|
||||
script_name="setup.py",
|
||||
name="SIMNet",
|
||||
version=__version__,
|
||||
author="PaiGramTeam",
|
||||
url="https://github.com/PaiGramTeam/SIMNet",
|
||||
keywords="genshin and honkai api wrapper",
|
||||
description="Modern API wrapper for Genshin Impact & Honkai: Star Rail built on asyncio and pydantic.",
|
||||
long_description=open("README.md", "r", encoding="utf-8").read(),
|
||||
long_description_content_type="text/markdown",
|
||||
packages=find_packages(exclude=["tests*"]),
|
||||
install_requires=requirements,
|
||||
include_package_data=True,
|
||||
python_requires=">=3.8",
|
||||
)
|
||||
|
||||
return kwargs
|
||||
|
||||
|
||||
def main(): # skipcq: PY-D0003
|
||||
setup(**get_setup_kwargs())
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
5
tests/test_setup.py
Normal file
5
tests/test_setup.py
Normal file
@ -0,0 +1,5 @@
|
||||
import os
|
||||
|
||||
|
||||
def test_build():
|
||||
assert os.system("python setup.py") == 0 # pragma: no cover
|
Loading…
Reference in New Issue
Block a user