Skip to content

Commit

Permalink
Recreate upgrade Makefile target
Browse files Browse the repository at this point in the history
Use `$ make upgrade` to upgrade only the top-level packages enumerated
in `requirements-to-freeze.txt`.

Use `$ make upgrade recursive=true` to recreate the `venv` from scratch
and to upgrade both the top-level packages as well as all of the
recursively installed packages.
  • Loading branch information
brainix committed Nov 18, 2020
1 parent 2e3c80b commit 7d26fd6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ venv ?= venv

init: formulae := {openssl,readline,xz,redis}

python requirements: version ?= 3.9.0
python upgrade: version ?= 3.9.0


.PHONY: release clean
Expand Down Expand Up @@ -38,9 +38,11 @@ python:
pip3 install --upgrade --no-cache-dir pip wheel && \
pip3 install --requirement requirements.txt

requirements:
upgrade:
ifneq ($(recursive),)
rm -rf $(venv)
~/.pyenv/versions/$(version)/bin/python3 -m venv $(venv)
endif
source $(venv)/bin/activate && \
pip3 install --upgrade --no-cache-dir pip wheel && \
pip3 install --requirement requirements-to-freeze.txt --upgrade --no-cache-dir && \
Expand Down

0 comments on commit 7d26fd6

Please sign in to comment.