Skip to content

Commit

Permalink
build: add --no-user for pip commands in Makefile
Browse files Browse the repository at this point in the history
I ran into "Cannot combine --user and --target" in an environment and
adding --no-user seemed to fix it.

Refs: https://stackoverflow.com/a/67259534/436641

PR-URL: #40169
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Christian Clauss <[email protected]>
  • Loading branch information
Trott authored and targos committed Oct 4, 2021
1 parent e22ca06 commit eaf9d08
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1392,8 +1392,8 @@ cpplint: lint-cpp
# Try with '--system' if it fails without; the system may have set '--user'
lint-py-build:
$(info Pip installing flake8 linter on $(shell $(PYTHON) --version)...)
$(PYTHON) -m pip install --upgrade -t tools/pip/site-packages flake8 || \
$(PYTHON) -m pip install --upgrade --system -t tools/pip/site-packages flake8
$(PYTHON) -m pip install --no-user --upgrade -t tools/pip/site-packages flake8 || \
$(PYTHON) -m pip install --no-user --upgrade --system -t tools/pip/site-packages flake8

ifneq ("","$(wildcard tools/pip/site-packages/flake8)")
.PHONY: lint-py
Expand All @@ -1412,8 +1412,8 @@ endif
# Try with '--system' if it fails without; the system may have set '--user'
lint-yaml-build:
$(info Pip installing yamllint on $(shell $(PYTHON) --version)...)
$(PYTHON) -m pip install --upgrade -t tools/pip/site-packages yamllint || \
$(PYTHON) -m pip install --upgrade --system -t tools/pip/site-packages yamllint
$(PYTHON) -m pip install --no-user --upgrade -t tools/pip/site-packages yamllint || \
$(PYTHON) -m pip install --no-user --upgrade --system -t tools/pip/site-packages yamllint

.PHONY: lint-yaml
# Lints the YAML files with yamllint.
Expand Down

0 comments on commit eaf9d08

Please sign in to comment.