Skip to content

Commit 2e57db6

Browse files
committed
Fix SDK release building
Signed-off-by: Willem Pienaar <git@willem.co>
1 parent 96d8ff7 commit 2e57db6

3 files changed

Lines changed: 12 additions & 15 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ dmypy.json
185185
*.code-workspace
186186

187187
# Protos
188+
sdk/python/docs/source
188189
sdk/python/docs/html
189190
sdk/python/feast/protos/
190191
sdk/python/tensorflow_metadata

.pre-commit-config.yaml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1+
default_stages:
2+
- push
13
repos:
24
- repo: local
35
hooks:
46
- id: lint
57
name: Lint
68
stages: [ push ]
79
language: system
8-
entry: make lint
9-
- id: compile-protos-python
10-
name: Compile Python Protos
11-
stages: [ push ]
12-
language: system
13-
entry: make compile-protos-python
10+
entry: make lint

sdk/python/setup.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
from setuptools.command.install import install
2424
from setuptools.command.develop import develop
2525
from setuptools.command.egg_info import egg_info
26+
from setuptools.command.sdist import sdist
27+
2628
except ImportError:
2729
from distutils.core import setup
2830
from distutils.command.install import install
@@ -61,9 +63,9 @@
6163
# README file from Feast repo root directory
6264
repo_root = (
6365
subprocess.Popen(["git", "rev-parse", "--show-toplevel"], stdout=subprocess.PIPE)
64-
.communicate()[0]
65-
.rstrip()
66-
.decode("utf-8")
66+
.communicate()[0]
67+
.rstrip()
68+
.decode("utf-8")
6769
)
6870
README_FILE = os.path.join(repo_root, "README.md")
6971
with open(os.path.join(README_FILE), "r") as f:
@@ -76,20 +78,15 @@
7678
r"^(?:[\/\w-]+)?(?P<version>[vV]?\d+(?:\.\d+){0,2}[^\+]*)(?:\+.*)?$"
7779
)
7880

79-
8081
proto_dirs = [x for x in os.listdir(repo_root + "/protos/feast")]
8182
proto_dirs.remove("third_party")
8283

8384

8485
def pre_install_build():
85-
"""
86-
Build Python protos when installing Feast using setup.py
87-
"""
8886
subprocess.check_call("make compile-protos-python", shell=True, cwd=f"{repo_root}")
8987
subprocess.check_call("make build-sphinx", shell=True, cwd=f"{repo_root}")
9088

9189

92-
# Classes used to inject pre_install_build()
9390
class CustomInstallCommand(install):
9491
def do_egg_install(self):
9592
pre_install_build()
@@ -116,7 +113,7 @@ def run(self):
116113
long_description_content_type="text/markdown",
117114
python_requires=REQUIRES_PYTHON,
118115
url=URL,
119-
packages=find_packages(exclude=("tests",)),
116+
packages=find_packages(exclude=("tests",)) + ['.'],
120117
install_requires=REQUIRED,
121118
# https://stackoverflow.com/questions/28509965/setuptools-development-requirements
122119
# Install dev requirements with: pip install -e .[dev]
@@ -143,6 +140,8 @@ def run(self):
143140
"protos/feast/**/*.proto",
144141
"protos/feast/third_party/grpc/health/v1/*.proto",
145142
"protos/tensorflow_metadata/proto/v0/*.proto",
143+
"feast/protos/feast/**/*.py",
144+
"tensorflow_metadata/proto/v0/*.py"
146145
],
147146
},
148147
cmdclass={

0 commit comments

Comments
 (0)