File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -111,17 +111,29 @@ bundle-update-all := --all
111111endif
112112
113113# # Python
114+
114115ifeq (true,$(CI ) )
116+ # PEP 668 really messes with things here.
117+ ifeq (root,$(USER ) )
118+ break-system-packages := --break-system-packages
119+ else
120+ ifeq (0,$(shell id -u) )
121+ break-system-packages := --break-system-packages
122+ endif
123+ endif
115124# Override VENVDIR so we can use caching in CI.
116125VENVDIR = $(realpath .) /.venv
117126endif
127+
118128VENVDIR ?= $(realpath $(LIBDIR ) ) /.venv
119129REQUIREMENTS_TXT := $(wildcard requirements.txt)
130+
120131ifneq (,$(strip $(REQUIREMENTS_TXT ) ) )
121132# Need to maintain a local marker file in case the lib/ directory is shared.
122133LOCAL_VENV := .requirements.txt
123134DEPS_FILES += $(LOCAL_VENV )
124135endif
136+
125137ifneq (true,$(CI ) )
126138# Don't install from lib/requirements.txt in CI; these are in the docker image.
127139REQUIREMENTS_TXT += $(LIBDIR ) /requirements.txt
@@ -133,7 +145,8 @@ ifeq (true,$(CI))
133145# Under CI, install from the local requirements.txt, but install globally (no venv).
134146pip ?= pip3
135147$(LOCAL_VENV ) :
136- $(pip ) install $(no-cache-dir ) $(foreach path,$(REQUIREMENTS_TXT ) ,-r $(path ) )
148+ @which $(pip )
149+ $(pip ) install $(no-cache-dir ) $(break-system-packages ) $(foreach path,$(REQUIREMENTS_TXT ) ,-r $(path ) )
137150 @touch $@
138151
139152# No clean-deps target in CI..
You can’t perform that action at this time.
0 commit comments