Skip to content

Commit

Permalink
Add Python pip upgrade strategy to 'eager'
Browse files Browse the repository at this point in the history
The --upgrade-strategy option is now set by default to the
'eager'. The --upgrade option does not enforce upgrade to
the latest version if there is already a version from a
Python module that satisfies the requirement. For example
pyyaml is not pinned to make the tool to install with wide
variety of mandatory modules. For development, the latest
is preferred.

This can be controlled with Makefile variable PIP_UPGRADEi.

Signed-off-by: Heikki Laaksonen <laaksonen.heikki.j@gmail.com>
  • Loading branch information
heilaaks committed Apr 9, 2020
1 parent 0abc1e4 commit 2d92d99
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ TAG_VERSION ?= 0.11.0
PIP ?= pip
PIP_CACHE ?=
PIP_PROXY ?= ""
PIP_UPGRADE ?= --upgrade --upgrade-strategy eager
PYTHON ?= python
PYTHON_VERSION ?= $(shell python -c 'import sys; print(sys.version_info[0])')
INSTALL_USER ?=
Expand Down Expand Up @@ -45,26 +46,26 @@ install:
$(PIP) install $(PIP_CACHE) $(QUIET) $(INSTALL_USER) --proxy $(PIP_PROXY) .

upgrade:
$(PIP) install --upgrade $(PIP_CACHE) $(QUIET) $(INSTALL_USER) --proxy $(PIP_PROXY) .
$(PIP) install $(PIP_UPGRADE) $(PIP_CACHE) $(QUIET) $(INSTALL_USER) --proxy $(PIP_PROXY) .

uninstall:
$(PIP) uninstall $(QUIET) --yes snippy

upgrade-wheel:
test -x "$(shell which pip)" || $(PYTHON) -m ensurepip $(INSTALL_USER)
$(PYTHON) -m pip install $(PIP_CACHE) $(QUIET) $(INSTALL_USER) --proxy $(PIP_PROXY) .[release]
$(PYTHON) -m pip install $(PIP_UPGRADE) $(PIP_CACHE) $(QUIET) $(INSTALL_USER) --proxy $(PIP_PROXY) .[release]

install-devel:
$(PYTHON) -m pip install $(PIP_CACHE) $(QUIET) $(INSTALL_USER) --proxy $(PIP_PROXY) .[devel]
$(PYTHON) -m pip install $(PIP_UPGRADE) $(PIP_CACHE) $(QUIET) $(INSTALL_USER) --proxy $(PIP_PROXY) .[devel]

install-test:
$(PYTHON) -m pip install $(PIP_CACHE) $(QUIET) $(INSTALL_USER) --proxy $(PIP_PROXY) .[test]
$(PYTHON) -m pip install $(PIP_UPGRADE) $(PIP_CACHE) $(QUIET) $(INSTALL_USER) --proxy $(PIP_PROXY) .[test]

install-server:
$(PYTHON) -m pip install $(PIP_CACHE) $(QUIET) $(INSTALL_USER) --proxy $(PIP_PROXY) .[server]
$(PYTHON) -m pip install $(PIP_UPGRADE) $(PIP_CACHE) $(QUIET) $(INSTALL_USER) --proxy $(PIP_PROXY) .[server]

install-coverage:
$(PYTHON) -m pip install $(PIP_CACHE) $(QUIET) $(INSTALL_USER) --proxy $(PIP_PROXY) codecov coveralls
$(PYTHON) -m pip install $(PIP_UPGRADE) $(PIP_CACHE) $(QUIET) $(INSTALL_USER) --proxy $(PIP_PROXY) codecov coveralls

outdated:
$(PYTHON) -m pip list --outdated --proxy $(PIP_PROXY)
Expand Down

0 comments on commit 2d92d99

Please sign in to comment.