HonahX commented on code in PR #1995:
URL: https://github.com/apache/polaris/pull/1995#discussion_r2191124000


##########
client/python/Makefile:
##########
@@ -15,10 +15,38 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
+VENV_DIR := .venv
+
+.PHONY: regenerate-client test-integration lint setup-env install-poetry-deps 
clean clean-venv
+
+# Target to create the virtual environment directory
+$(VENV_DIR):
+       @echo "Setting up Python virtual environment at $(VENV_DIR)..."
+       python3 -m venv $(VENV_DIR)
+       @echo "Virtual environment created."
+
+# Target to ensure the virtual environment and poetry/dependencies are set up
+setup-env: $(VENV_DIR) install-poetry-deps
+
+# Target to install poetry and project dependencies
+install-poetry-deps: # This target doesn't *create* $(VENV_DIR), but *uses* it.
+       @echo "Installing Poetry and project dependencies into $(VENV_DIR)..."
+       # Ensure pip is up-to-date within the venv
+       $(VENV_DIR)/bin/pip install --upgrade pip
+       # Install poetry if not already present
+       @if [ ! -f "$(VENV_DIR)/bin/poetry" ]; then \
+               $(VENV_DIR)/bin/pip install poetry; \

Review Comment:
   How about pinning the poetry version to make it consistent with
   
https://github.com/apache/polaris/blob/d962c64260ef7f2a09bd9ab802ce8a01df90ee02/regtests/requirements.txt#L20
   It does look weird that client source code refer to a dep version in regtest 
not vice versa, but I can improve this in follow-ups



##########
client/python/Makefile:
##########
@@ -30,6 +58,22 @@ test-integration:
        @echo "Polaris is healthy. Starting integration tests..."
        poetry run pytest integration_tests/ ${PYTEST_ARGS}
 
+# Target to run linting checks
+lint: setup-env

Review Comment:
   Thanks for adding the setup-env to make the env more isolated and automated. 
Could you please also update the workflow file to remove the poetry 
installation step?
   
https://github.com/apache/polaris/blob/d962c64260ef7f2a09bd9ab802ce8a01df90ee02/.github/workflows/python-client.yml#L61-L63
   
   This could help make the local test env and CI env consistent. We may need 
another `test` target to run all the auto-generated unit test.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@polaris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to