File tree Expand file tree Collapse file tree 2 files changed +182
-174
lines changed Expand file tree Collapse file tree 2 files changed +182
-174
lines changed Original file line number Diff line number Diff line change 11# * Variables
22SHELL ?= /usr/bin/env bash
3- PYTHON_PATH = $(shell which python)
4- PYTHON_ROOT := $(dir $(PYTHON_PATH ) )
3+
54# use the directory rather than the python binary to allow auto-discovery, which is more cross-platform compatible
6- UV_PYTHON_PATH ?= $(UV_PYTHON_ROOT )
5+ PYTHON_PATH := $(shell which python)
6+ PYTHON_ROOT := $(shell dirname $(dir $(PYTHON_PATH ) ) )
7+ UV_PYTHON_ROOT ?= $(PYTHON_ROOT )
8+
79# to actually reuse an existing virtual/conda environment, the 'UV_PROJECT_ENVIRONMENT' variable must be set to it
810# use this command:
911# UV_PROJECT_ENVIRONMENT=/path/to/env make [target]
1012# consider exporting this variable in '/path/to/env/etc/conda/activate.d/env.sh' to enable it by default when
1113# activating a conda environment, and reset it in '/path/to/env/etc/conda/deactivate.d/env.sh'
12- UV_PROJECT_ENVIRONMENT ?= .venv
14+ UV_PROJECT_ENVIRONMENT ?=
1315# make sure every uv command employs the specified environment path
14- UV_COMMAND ?= UV_PROJECT_ENVIRONMENT="$(UV_PROJECT_ENVIRONMENT ) " uv
16+ ifeq (${UV_PROJECT_ENVIRONMENT},)
17+ UV_COMMAND := uv
18+ else
19+ UV_COMMAND := UV_PROJECT_ENVIRONMENT="${UV_PROJECT_ENVIRONMENT}" uv
20+ endif
1521
1622# * UV
1723.PHONY : setup
You can’t perform that action at this time.
0 commit comments