Skip to content

Commit 34c997d

Browse files
authored
fix: Prefer installing gopy from feast's fork as opposed to upstream (#2839)
* fix: Prefer installing gopy from feast's fork as opposed to upstream Signed-off-by: Achal Shah <[email protected]> * use go mod tidy Signed-off-by: Achal Shah <[email protected]> * pin and pray Signed-off-by: Achal Shah <[email protected]> * fix import path Signed-off-by: Achal Shah <[email protected]> * nix go install Signed-off-by: Achal Shah <[email protected]> * pin go get and add back unpinned go install, and fix other tests Signed-off-by: Achal Shah <[email protected]> * cr Signed-off-by: Achal Shah <[email protected]>
1 parent 1b59d2f commit 34c997d

File tree

6 files changed

+21
-18
lines changed

6 files changed

+21
-18
lines changed

Makefile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,10 +170,12 @@ install-go-proto-dependencies:
170170
go install google.golang.org/grpc/cmd/[email protected]
171171

172172
install-go-ci-dependencies:
173-
# ToDo: currently gopy installation doesn't work w/o explicit go get in the next line
174-
# ToDo: there should be a better way to install gopy
175-
go get github.com/go-python/gopy
173+
# TODO: currently gopy installation doesn't work w/o explicit go get in the next line
174+
# TODO: there should be a better way to install gopy
175+
go get github.com/go-python/gopy@v0.4.0
176176
go install golang.org/x/tools/cmd/goimports
177+
# The `go get` command on the previous lines download the lib along with replacing the dep to `feast-dev/gopy`
178+
# but the following command is needed to install it for some reason.
177179
go install github.com/go-python/gopy
178180
python -m pip install pybindgen==0.22.0
179181

go.mod

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ module github.com/feast-dev/feast
22

33
go 1.17
44

5+
replace github.com/go-python/gopy v0.4.0 => github.com/feast-dev/gopy v0.4.1-0.20220429180328-4257ac71a4d0
6+
57
require (
68
github.com/apache/arrow/go/v8 v8.0.0-20220408212425-58fe60f59289
79
github.com/ghodss/yaml v1.0.0
@@ -26,8 +28,6 @@ require (
2628
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
2729
github.com/goccy/go-json v0.9.6 // indirect
2830
github.com/golang/snappy v0.0.4 // indirect
29-
github.com/gonuts/commander v0.1.0 // indirect
30-
github.com/gonuts/flag v0.1.0 // indirect
3131
github.com/google/flatbuffers v2.0.6+incompatible // indirect
3232
github.com/klauspost/asmfmt v1.3.2 // indirect
3333
github.com/klauspost/compress v1.15.1 // indirect
@@ -42,12 +42,10 @@ require (
4242
golang.org/x/net v0.0.0-20220407224826-aac1ed45d8e3 // indirect
4343
golang.org/x/sys v0.0.0-20220406163625-3f8b81556e12 // indirect
4444
golang.org/x/text v0.3.7 // indirect
45-
golang.org/x/tools v0.1.10 // indirect
45+
golang.org/x/tools v0.1.11-0.20220413170336-afc6aad76eb1 // indirect
4646
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
4747
google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac // indirect
4848
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
4949
gopkg.in/yaml.v2 v2.4.0 // indirect
5050
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect
5151
)
52-
53-
replace github.com/go-python/gopy v0.4.0 => github.com/feast-dev/gopy v0.4.1-0.20220429180328-4257ac71a4d0

go.sum

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,7 @@ github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiu
146146
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
147147
github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=
148148
github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
149-
github.com/gonuts/commander v0.1.0 h1:EcDTiVw9oAVORFjQOEOuHQqcl6OXMyTgELocTq6zJ0I=
150149
github.com/gonuts/commander v0.1.0/go.mod h1:qkb5mSlcWodYgo7vs8ulLnXhfinhZsZcm6+H/z1JjgY=
151-
github.com/gonuts/flag v0.1.0 h1:fqMv/MZ+oNGu0i9gp0/IQ/ZaPIDoAZBOBaJoV7viCWM=
152150
github.com/gonuts/flag v0.1.0/go.mod h1:ZTmTGtrSPejTo/SRNhCqwLTmiAgyBdCkLYhHrAoBdz4=
153151
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
154152
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
@@ -548,8 +546,8 @@ golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4f
548546
golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
549547
golang.org/x/tools v0.1.8-0.20211029000441-d6a9af8af023/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU=
550548
golang.org/x/tools v0.1.9/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU=
551-
golang.org/x/tools v0.1.10 h1:QjFRCZxdOhBJ/UNgnBZLbNV13DlbnK0quyivTnXJM20=
552-
golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E=
549+
golang.org/x/tools v0.1.11-0.20220413170336-afc6aad76eb1 h1:Z3vE1sGlC7qiyFJkkDcZms8Y3+yV8+W7HmDSmuf71tM=
550+
golang.org/x/tools v0.1.11-0.20220413170336-afc6aad76eb1/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E=
553551
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
554552
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
555553
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=

sdk/python/tests/integration/online_store/test_e2e_local.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,15 +130,15 @@ def _test_materialize_and_online_retrieval(
130130
cwd=Path(store.repo_path),
131131
)
132132

133-
assert r.returncode == 0
133+
assert r.returncode == 0, f"stdout: {r.stdout}\n stderr: {r.stderr}"
134134
_assert_online_features(store, driver_df, end_date - timedelta(days=7))
135135

136136
# Test `feast materialize-incremental` and online retrieval.
137137
r = runner.run(
138138
["materialize-incremental", end_date.isoformat()], cwd=Path(store.repo_path),
139139
)
140140

141-
assert r.returncode == 0
141+
assert r.returncode == 0, f"stdout: {r.stdout}\n stderr: {r.stderr}"
142142
_assert_online_features(store, driver_df, end_date)
143143

144144

sdk/python/tests/utils/cli_utils.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,13 @@ def local_repo(self, example_repo_py: str, offline_store: str):
8484
repo_example.write_text(example_repo_py)
8585

8686
result = self.run(["apply"], cwd=repo_path)
87-
assert result.returncode == 0
87+
assert (
88+
result.returncode == 0
89+
), f"stdout: {result.stdout}\n stderr: {result.stderr}"
8890

8991
yield FeatureStore(repo_path=str(repo_path), config=None)
9092

9193
result = self.run(["teardown"], cwd=repo_path)
92-
assert result.returncode == 0
94+
assert (
95+
result.returncode == 0
96+
), f"stdout: {result.stdout}\n stderr: {result.stderr}"

setup.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,7 @@ def _is_go_ext(self, ext: Extension):
408408
)
409409

410410
def build_extension(self, ext: Extension):
411+
print(f"Building extension {ext}")
411412
if not self._is_go_ext(ext):
412413
# the base class may mutate `self.compiler`
413414
compiler = copy.deepcopy(self.compiler)
@@ -423,8 +424,7 @@ def build_extension(self, ext: Extension):
423424
)
424425

425426
destination = os.path.dirname(os.path.abspath(self.get_ext_fullpath(ext.name)))
426-
subprocess.check_call(["go", "install", "golang.org/x/tools/cmd/goimports"])
427-
subprocess.check_call(["go", "install", "github.com/go-python/gopy"])
427+
subprocess.check_call(["go", "mod", "tidy"], env={"PATH": bin_path, **go_env})
428428
subprocess.check_call(
429429
[
430430
"gopy",
@@ -456,6 +456,7 @@ def copy_extensions_to_source(self):
456456
src_dir = os.path.join(self.build_lib, src_dir)
457457

458458
# copy whole directory
459+
print(f"Copying from {src_dir} to {dest_dir}")
459460
copy_tree(src_dir, dest_dir)
460461

461462

0 commit comments

Comments
 (0)