forked from lelit/pglast
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.virtualenv
49 lines (38 loc) · 1.3 KB
/
Makefile.virtualenv
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# -*- coding: utf-8 -*-
# :Project: pglast -- Virtualenv targets
# :Created: gio 03 ago 2017 16:55:55 CEST
# :Author: Lele Gaifax <[email protected]>
# :License: GNU General Public License version 3 or later
# :Copyright: © 2017, 2018, 2020 Lele Gaifax
#
ACTIVATE_SCRIPT := $(VENVDIR)/bin/activate
PIP := $(VENVDIR)/bin/pip
REQUIREMENTS ?= requirements.txt
REQUIREMENTS_TIMESTAMP := $(VENVDIR)/$(REQUIREMENTS).timestamp
help::
@printf "\nPython virtualenv related targets\n"
@printf "=================================\n\n"
help::
@printf "virtualenv\n\tsetup the Python virtualenv and install required packages\n"
.PHONY: virtualenv
virtualenv: $(VENVDIR) requirements
$(VENVDIR):
@echo "Bootstrapping Python 3 virtualenv..."
@$(SYS_PYTHON) -m venv --prompt $(notdir $(TOPDIR)) $@
@$(MAKE) upgrade-pip
help::
@printf "upgrade-pip\n\tupgrade pip\n"
.PHONY: upgrade-pip
upgrade-pip:
@echo "Upgrading pip..."
@$(PIP) install --no-cache-dir --upgrade pip
help::
@printf "requirements\n\tinstall/update required Python packages\n"
.PHONY: requirements
requirements: $(REQUIREMENTS_TIMESTAMP)
$(REQUIREMENTS_TIMESTAMP): $(REQUIREMENTS)
@echo "Installing pre-requirements..."
@PATH="$(TOPDIR)/bin:$(PATH)" $(PIP) install --no-cache-dir -r $(REQUIREMENTS)
@touch $@
distclean::
rm -rf $(VENVDIR)