Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(python): if already in an active virtual environment, use it (do not force/assume ".venv") #10159

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion py-polars/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,30 @@

PYTHONPATH=
SHELL=/bin/bash
VENV = .venv
VENV_DEFAULT=.venv

ifeq ($(VIRTUAL_ENV), )
VENV=VENV_DEFAULT
else
VENV=$(VIRTUAL_ENV)
endif

ifeq ($(OS),Windows_NT)
VENV_BIN=$(VENV)/Scripts
else
VENV_BIN=$(VENV)/bin
endif


.venv: ## Set up virtual environment and install requirements
python3 -m venv $(VENV)
$(MAKE) requirements


testing: ## stuff
## https://gist.github.com/rueycheng/42e355d1480fd7a33ee81c866c7fdf78
@echo $(dir $(VENV_BIN))

.PHONY: requirements
requirements: .venv ## Install/refresh all project requirements
$(VENV_BIN)/python -m pip install --upgrade pip
Expand Down