diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..096dd50 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,2 @@ +include LICENSE +include requirements.txt diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..b575b17 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,6 @@ +[build-system] +requires = [ + "packaging", + "setuptools", + "aiohttp", +] diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..67a0212 --- /dev/null +++ b/setup.py @@ -0,0 +1,63 @@ +import io +import os +import re +from typing import List + +import setuptools + +SETUP_DIR = os.path.dirname(__file__) + + +def get_path(*filepath) -> str: + return os.path.join(SETUP_DIR, *filepath) + + +def find_version(filepath: str): + """Extract version information from the given filepath. + + Adapted from https://github.com/ray-project/ray/blob/0b190ee1160eeca9796bc091e07eaebf4c85b511/python/setup.py + """ + with open(filepath) as fp: + version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", fp.read(), re.M) + if version_match: + return version_match.group(1) + raise RuntimeError("Unable to find version string.") + + +def read_readme() -> str: + """Read the README file.""" + return io.open(get_path("README.md"), "r", encoding="utf-8").read() + + +def get_requirements() -> List[str]: + """Get Python package dependencies from requirements.txt.""" + with open(get_path("requirements.txt")) as f: + requirements = f.read().strip().split("\n") + return requirements + + +setuptools.setup( + name="vllm_client", + version=find_version(get_path("vllm_client", "__init__.py")), + author="vLLM Team", + license="Apache 2.0", + description=("Client for the vLLM API with minimal dependencies"), + long_description=read_readme(), + long_description_content_type="text/markdown", + url="https://github.com/vllm-project/vllm", + project_urls={ + "Homepage": "https://github.com/vllm-project/vllm", + "Documentation": "https://vllm.readthedocs.io/en/latest/", + }, + classifiers=[ + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "License :: OSI Approved :: Apache Software License", + "Topic :: Scientific/Engineering :: Artificial Intelligence", + ], + packages=setuptools.find_packages(exclude=("tests",)), + python_requires=">=3.8", + install_requires=get_requirements() +)