From de97bd329425374b25a09c6a8241ce2d99af4a64 Mon Sep 17 00:00:00 2001 From: Achal Shah Date: Tue, 31 May 2022 11:12:12 -0700 Subject: [PATCH] chore: Install dependencies into a virtualenv for gitpod (#2749) * chore: Add pybindgen to setup_requires Signed-off-by: Achal Shah * chore: Add env to gopy command Signed-off-by: Achal Shah * remove clone Signed-off-by: Achal Shah * More fixes Signed-off-by: Achal Shah * Fix protos persistance Signed-off-by: Achal Shah * Just create a virtualenv locally Signed-off-by: Achal Shah * compile python protos Signed-off-by: Achal Shah * rmove env stuff Signed-off-by: Achal Shah * fix Signed-off-by: Achal Shah --- .gitpod.Dockerfile | 5 ----- .gitpod.yml | 14 ++++++++++++-- setup.py | 6 ++---- 3 files changed, 14 insertions(+), 11 deletions(-) delete mode 100644 .gitpod.Dockerfile diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile deleted file mode 100644 index 2249395567..0000000000 --- a/.gitpod.Dockerfile +++ /dev/null @@ -1,5 +0,0 @@ -FROM gitpod/workspace-full:latest - -ENV PYTHONUSERBASE=/workspace/.pip-modules -ENV PATH=$PYTHONUSERBASE/bin:$PATH -ENV PIP_USER=yes diff --git a/.gitpod.yml b/.gitpod.yml index 4b3585e98a..b28dfbe49f 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -1,14 +1,20 @@ # https://www.gitpod.io/docs/config-gitpod-file -image: - file: .gitpod.Dockerfile tasks: - init: | + python -m venv venv + source venv/bin/activate + pip install pre-commit pre-commit install --hook-type pre-commit --hook-type pre-push pip install '.[dev]' + make compile-protos-python make compile-protos-go make compile-go-lib + env: + PYTHONUSERBASE: "/workspace/.pip-modules" command: | + source venv/bin/activate + git config --global alias.ci 'commit -s' git config --global alias.sw switch git config --global alias.st status @@ -31,3 +37,7 @@ github: addComment: false # add a "Review in Gitpod" button to the pull request's description (defaults to false) addBadge: false + +vscode: + extensions: + - ms-python.python diff --git a/setup.py b/setup.py index f1cc3119fe..8934ca24ad 100644 --- a/setup.py +++ b/setup.py @@ -249,7 +249,6 @@ def _generate_python_protos(self, path: str): self.python_folder, ] + proto_files, - env=os.environ ) def run(self): @@ -335,8 +334,6 @@ def _generate_go_protos(self, path: str): proto_files = glob.glob(os.path.join(self.proto_folder, path)) try: - e = os.environ.copy() - e["PATH"] = self.path_val subprocess.check_call( self.go_protoc + [ @@ -350,7 +347,7 @@ def _generate_go_protos(self, path: str): "--go-grpc_opt=module=github.com/feast-dev/feast/go/protos", ] + proto_files, - env=e, + env={"PATH": self.path_val}, ) except CalledProcessError as e: print(f"Stderr: {e.stderr}") @@ -499,6 +496,7 @@ def copy_extensions_to_source(self): "grpcio", "grpcio-tools==1.44.0", "mypy-protobuf==3.1", + "pybindgen==0.22.0", "sphinx!=4.0.0", ], cmdclass={