Uh oh!
There was an error while loading. Please reload this page.
This repository was archived by the owner on Mar 11, 2022. It is now read-only.
- Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathsetup.py
More file actions
Latest commit
76 lines (61 loc) · 2.16 KB
/
Copy pathsetup.py
File metadata and controls
76 lines (61 loc) · 2.16 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
"""
Copyright 2020 Lightbend Inc.
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("cloudstate/version.py").read())
PROTOBUF_VERSION="master"
version=__version__# noqa
name="cloudstate"
print(f"package name: {name}, version: {version}", flush=True)
proto_lib_roots= ["protobuf/lib"]
proto_roots= ["."]
classFetchBuildProtosCommand(build_py):
"""fetch libs and install the protocol buffer generated sources."""
defrun(self):
os.system(f"scripts/fetch-cloudstate-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"python -m grpc_tools.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/cloudstateio/python-support",
license="Apache 2.0",
description="Cloudstate Python Support Library",
packages=packages,
package_data={
"": ["*.proto"],
},
long_description=open("Description.md", "r").read(),
long_description_content_type="text/markdown",
zip_safe=False,
scripts=["scripts/fetch-cloudstate-pb.sh"],
install_requires=[
"attrs>=19.3.0",
"google-api>=0.1.12",
"googleapis-common-protos >= 1.51.0",
"grpcio>=1.31.0",
"grpcio-tools>=1.31.0",
"protobuf>=3.11.3",
"pytest>=5.4.2",
"six>=1.14.0",
"grpcio-reflection>=1.31.0",
"docker",
],
cmdclass={
"build_py": FetchBuildProtosCommand,
},
)