Skip to content

Commit

Permalink
add proto building on build step in setup.py
Browse files Browse the repository at this point in the history
Signed-off-by: Oleksii Moskalenko <moskalenko.alexey@gmail.com>
  • Loading branch information
pyalex committed Mar 25, 2021
1 parent 51b9568 commit ecc4083
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@
"google-cloud-bigquery-storage==0.7.*",
"google-cloud-dataproc==2.0.2",
"kubernetes==12.0.*",
"grpcio-tools==1.31.0",
"mypy-protobuf"
]

# README file from Feast repo root directory
Expand Down Expand Up @@ -102,20 +104,21 @@ def run(self):
self._generate_protos('feast_spark/third_party/grpc/health/v1/*.proto')


class DevelopCommand(develop):
"""Custom develop command."""
class BuildCommand(build_py):
"""Custom build command."""

def run(self):
self.run_command('build_proto')
develop.run(self)
build_py.run(self)


class DistWheelCommand(sdist):
"""Custom sdist command."""
class DevelopCommand(develop):
"""Custom develop command."""

def run(self):
self.run_command('build_proto')
sdist.run(self)
develop.run(self)


setup(
name=NAME,
Expand Down Expand Up @@ -145,10 +148,10 @@ def run(self):
],
entry_points={"console_scripts": ["feast-spark=feast_spark.cli:cli"]},
use_scm_version={"root": "../", "relative_to": __file__, "tag_regex": TAG_REGEX},
setup_requires=["setuptools_scm", "grpcio-tools", "feast", "mypy-protobuf"],
setup_requires=["setuptools_scm", "grpcio-tools==1.31.0", "feast", "mypy-protobuf"],
cmdclass={
"build_proto": BuildProtoCommand,
"sdist": DistWheelCommand,
"build_py": BuildCommand,
"develop": DevelopCommand,
},
)

0 comments on commit ecc4083

Please sign in to comment.