-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
105 lines (90 loc) · 3.64 KB
/
setup.py
File metadata and controls
105 lines (90 loc) · 3.64 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
"""setup.py: setuptools control."""
import codecs
import os.path
import sys
from typing import List
from setuptools import find_packages, setup
ROOT_DIR = os.path.abspath(os.path.dirname(__file__))
def read_file(rel_path: str) -> str:
"""Read a file and return the contents."""
_path = os.path.join(ROOT_DIR, rel_path)
if os.path.isfile(_path):
with codecs.open(_path, "r") as fp:
return fp.read()
else:
return ""
def get_project_name_and_version(rel_path: str) -> List[str]:
"""Get the project name and version from a file specified by __version__ = name@version."""
for line in read_file(rel_path).splitlines():
if line.startswith("__version__"):
delim = '"' if '"' in line else "'"
return line.split(delim)[1].split("@")
else:
raise RuntimeError("Unable to find version string.")
def get_requirements() -> List[str]:
"""Get Python package dependencies from requirements.txt."""
def _read_requirements(filename: str) -> List[str]:
requirements = read_file(filename).strip().split("\n")
resolved_requirements = []
for line in requirements:
if line.startswith("-r "):
resolved_requirements += _read_requirements(line.split()[1])
else:
resolved_requirements.append(line)
return resolved_requirements
return _read_requirements("requirements.txt")
name, version = get_project_name_and_version("budconnect/__about__.py")
version_range_max = max(sys.version_info[1], 10) + 1
setup(
name=name,
version=version,
description=(
"BudConnect is a cloud service that provides compatibility checking and update synchronization for Bud inference runtimes on customer infrastructure. It acts as a central registry for validated models and engine versions."
),
long_description=read_file("README.md"),
long_description_content_type="text/markdown",
url="https://github.com/BudEcosystem/bud-connect",
project_urls={
"Homepage": "https://github.com/BudEcosystem/bud-connect",
"Documentation": "https://github.com/BudEcosystem/bud-connect/blob/main/README.md",
"Issues": "https://github.com/BudEcosystem/bud-connect/issues",
"Changelog": "https://github.com/BudEcosystem/bud-connect/blob/main/CHANGELOG.md",
},
keywords="pre-commit hooks testing documentation profiling code quality project maintenance"
"best practices continuous integration code standards",
license="Apache 2.0 License",
author="Bud Ecosystem Inc.",
package_dir={"": "./"},
packages=find_packages(
"budconnect",
exclude=(
"docs",
"examples",
"tests",
"docker",
"assets*",
"dist*",
"scripts*",
"README.md",
".gitignore",
"requirements*.txt",
),
),
package_data={"budconnect": ["py.typed"]},
include_package_data=True,
python_requires=">=3.8.0",
install_requires=get_requirements(),
extras_require={},
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Topic :: Software Development :: Quality Assurance",
"Topic :: Software Development :: Testing",
"Topic :: Software Development :: Documentation",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Environment :: Console",
"Framework :: Pytest" "Programming Language :: Python :: 3",
]
+ [f"Programming Language :: Python :: 3.{i}" for i in range(8, version_range_max)],
)