From 69185621f6926a9f5682f88b4c4f83e3ab15eb72 Mon Sep 17 00:00:00 2001 From: Achal Shah Date: Mon, 27 Jun 2022 11:07:40 -0700 Subject: [PATCH 1/4] fix: Go install gopy instead using go mod tidy Signed-off-by: Achal Shah --- .../feature_repos/integration_test_repo_config.py | 4 ++-- setup.py | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/sdk/python/tests/integration/feature_repos/integration_test_repo_config.py b/sdk/python/tests/integration/feature_repos/integration_test_repo_config.py index 61920bb03f8..74ce37f17a6 100644 --- a/sdk/python/tests/integration/feature_repos/integration_test_repo_config.py +++ b/sdk/python/tests/integration/feature_repos/integration_test_repo_config.py @@ -51,8 +51,8 @@ def __repr__(self) -> str: f"{self.provider.upper()}", f"{self.offline_store_creator.__name__.split('.')[-1].replace('DataSourceCreator', '')}", online_store_type, - f"python_fs={self.python_feature_server}", - f"go_fs={self.go_feature_retrieval}", + f"python_fs:{self.python_feature_server}", + f"go_fs:{self.go_feature_retrieval}", ] ) diff --git a/setup.py b/setup.py index 49b2d45d03f..a8de778e4d1 100644 --- a/setup.py +++ b/setup.py @@ -213,6 +213,7 @@ PYTHON_CODE_PREFIX = "sdk/python" + class BuildPythonProtosCommand(Command): description = "Builds the proto files into Python files." user_options = [ @@ -424,8 +425,13 @@ def build_extension(self, ext: Extension): ) destination = os.path.dirname(os.path.abspath(self.get_ext_fullpath(ext.name))) - subprocess.check_call(["go", "mod", "tidy"], env={"PATH": bin_path, **go_env}) - subprocess.check_call( + subprocess.check_call(["go", "install", "golang.org/x/tools/cmd/goimports"], + env={"PATH": bin_path, **go_env}) + subprocess.check_call(["go", "install", "github.com/go-python/gopy@v0.4.0"], + env={"PATH": bin_path, **go_env}) + subprocess.check_call(["go", "mod", "tidy"], + env={"PATH": bin_path, **go_env}) + r = subprocess.check_call( [ "gopy", "build", From 5da76a38307210ca4d092f2ae5d29f4f0c31971f Mon Sep 17 00:00:00 2001 From: Achal Shah Date: Mon, 27 Jun 2022 11:18:33 -0700 Subject: [PATCH 2/4] remove newline Signed-off-by: Achal Shah --- setup.py | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.py b/setup.py index a8de778e4d1..7c55c6c43da 100644 --- a/setup.py +++ b/setup.py @@ -213,7 +213,6 @@ PYTHON_CODE_PREFIX = "sdk/python" - class BuildPythonProtosCommand(Command): description = "Builds the proto files into Python files." user_options = [ From 4bf0c0488387b09b19325b72ba42d6c7132eb46e Mon Sep 17 00:00:00 2001 From: Achal Shah Date: Mon, 27 Jun 2022 11:43:59 -0700 Subject: [PATCH 3/4] fix Signed-off-by: Achal Shah --- setup.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 7c55c6c43da..52a411a603a 100644 --- a/setup.py +++ b/setup.py @@ -426,7 +426,9 @@ def build_extension(self, ext: Extension): destination = os.path.dirname(os.path.abspath(self.get_ext_fullpath(ext.name))) subprocess.check_call(["go", "install", "golang.org/x/tools/cmd/goimports"], env={"PATH": bin_path, **go_env}) - subprocess.check_call(["go", "install", "github.com/go-python/gopy@v0.4.0"], + subprocess.check_call(["go", "get", "github.com/go-python/gopy@v0.4.0"], + env={"PATH": bin_path, **go_env}) + subprocess.check_call(["go", "install", "github.com/go-python/gopy"], env={"PATH": bin_path, **go_env}) subprocess.check_call(["go", "mod", "tidy"], env={"PATH": bin_path, **go_env}) From 7c4824f2bffa1f690c1b9a0779c8ad0b614e9d04 Mon Sep 17 00:00:00 2001 From: Achal Shah Date: Mon, 27 Jun 2022 11:51:27 -0700 Subject: [PATCH 4/4] fix Signed-off-by: Achal Shah --- setup.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 52a411a603a..a166c28af48 100644 --- a/setup.py +++ b/setup.py @@ -423,6 +423,9 @@ def build_extension(self, ext: Extension): subprocess.check_output(["go", "env", "-json"]).decode("utf-8").strip() ) + print(f"Go env: {go_env}") + print(f"CWD: {os.getcwd()}") + destination = os.path.dirname(os.path.abspath(self.get_ext_fullpath(ext.name))) subprocess.check_call(["go", "install", "golang.org/x/tools/cmd/goimports"], env={"PATH": bin_path, **go_env}) @@ -432,7 +435,7 @@ def build_extension(self, ext: Extension): env={"PATH": bin_path, **go_env}) subprocess.check_call(["go", "mod", "tidy"], env={"PATH": bin_path, **go_env}) - r = subprocess.check_call( + subprocess.check_call( [ "gopy", "build",