Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.py
More file actions
Latest commit
73 lines (58 loc) · 2 KB
/
Copy pathsetup.py
File metadata and controls
73 lines (58 loc) · 2 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
"""
Copyright 2022 Eigr.
Licensed under the Apache License, Version 2.0.
"""
importos
importpathlib
fromsetuptoolsimportfind_packages, setup
# Load version in cloudstate package.
fromsetuptools.command.build_pyimportbuild_py
exec(open("spawn/version.py").read())
PROTOBUF_VERSION="master"
version=__version__# noqa
name="spawn"
print(f"package name: {name}, version: {version}", flush=True)
proto_lib_roots= ["protobuf"]
proto_roots= ["."]
classFetchBuildProtosCommand(build_py):
"""fetch libs and install the protocol buffer generated sources."""
defrun(self):
os.system(f"scripts/fetch-spawn-pb.sh {PROTOBUF_VERSION}")
forproto_rootinproto_roots+proto_lib_roots:
forroot, subdirs, filesinos.walk(proto_root):
forfilein [fforfinfilesiff.endswith(".proto")]:
file_path=pathlib.Path(root) /file
destination="."
print(f"compiling {file_path} to {destination}")
command=f"protoc {' '.join([' -I '+iforiinproto_roots+proto_lib_roots])} --python_out={destination} --grpc_python_out={destination}{file_path}"# noqa
os.system(command)
returnsuper().run()
packages=find_packages(exclude=[])
print(f"packages: {packages}")
setup(
name=name,
version=version,
url="https://github.com/eigr-labs/spawn-python-sdk",
license="Apache 2.0",
description="Spawn Python SDK",
packages=packages,
package_data={
"": ["*.proto"],
},
long_description=open("Description.md", "r").read(),
long_description_content_type="text/markdown",
zip_safe=False,
scripts=["scripts/fetch-spawn-pb.sh"],
install_requires=[
"attrs>=21.4.0",
"google-api>=0.1.12",
"googleapis-common-protos>=1.56.4",
"flask>=2.1.3",
"protobuf>=3.20.0",
"pytest>=7.1.2",
"docker",
],
cmdclass={
"build_py": FetchBuildProtosCommand,
},
)