aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Makefile
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2022-10-15 21:43:50 +0200
committerEgor Tensin <Egor.Tensin@gmail.com>2022-10-15 21:43:50 +0200
commite781dd7866a1df5cb5447c5b9abac60354732da9 (patch)
treec74558fc2f8fcc0bf37e0e67373cba38b7a74a99 /Makefile
parentv4.0.0 (diff)
downloadcgitize-e781dd7866a1df5cb5447c5b9abac60354732da9.tar.gz
cgitize-e781dd7866a1df5cb5447c5b9abac60354732da9.zip
Makefile: add venv-update command
It should fetch dependencies from setup.cfg and update them to the latest version.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile15
1 files changed, 13 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 6904c9d..e685816 100644
--- a/Makefile
+++ b/Makefile
@@ -121,13 +121,24 @@ buildx/push:
venv_dir := .venv
-.PHONY: venv
-venv:
+.PHONY: venv-reset
+venv-reset:
rm -rf -- '$(call escape,$(venv_dir))'
mkdir -p -- '$(call escape,$(venv_dir))'
python -m venv -- '$(call escape,$(venv_dir))'
+
+.PHONY: venv
+venv: venv-reset
. '$(call escape,$(venv_dir))/bin/activate' && pip install -r requirements.txt
+# Is there a better way?
+.PHONY: venv-update
+venv-update: venv-reset
+ . '$(call escape,$(venv_dir))/bin/activate' \
+ && pip install . \
+ && pip uninstall --yes "$$( python setup.py --name )" \
+ && pip freeze > requirements.txt
+
.PHONY: py
py: python