-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathsetup.py
67 lines (59 loc) · 1.96 KB
/
setup.py
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
"""Setup file"""
import io
import setuptools
with open("README.md", encoding="utf-8") as fp:
long_description = fp.read()
def read(*filenames, **kwargs):
"""function to read files like requirements.txt"""
encoding = kwargs.get("encoding", "utf-8")
# io.open defaults to \n as universal line ending no matter on what system
sep = kwargs.get("sep", "\n")
buf = []
for filename in filenames:
with io.open(filename, encoding=encoding) as f:
buf.append(f.read())
return sep.join(buf)
def read_requirements(req):
"""function to read requirements"""
content = read(req)
requirements = []
for line in content.split("\n"):
line = line.strip()
if line.startswith("#"):
continue
if line.startswith("-r"):
requirements.extend(read_requirements(line[3:]))
else:
requirements.append(line)
return requirements
setuptools.setup(
name="resource-schema-guard-rail",
version="0.0.16",
description="Schema Guard Rail",
long_description=long_description,
long_description_content_type="text/markdown",
author="Amazon Web Services",
author_email="aws-cloudformation-developers@amazon.com",
packages=setuptools.find_packages(where="src"),
package_dir={"": "src"},
py_modules=["cli"],
install_requires=read_requirements("requirements.txt"),
include_package_data=True,
python_requires=">=3.7",
entry_points={
"console_scripts": [
"guard-rail-cli = cli:main",
"guard-rail = cli:main",
]
},
license="Apache License 2.0",
classifiers=[
"Development Status :: 4 - Beta",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Natural Language :: English",
],
)