-
Notifications
You must be signed in to change notification settings - Fork 1
/
makefile
40 lines (29 loc) · 1.05 KB
/
makefile
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
# Disable printing of all the makefile commands
MAKEFLAGS += --silent
.PHONY: setup-venv test
PYTHON_VERSION = "3.9.15"
VENV_NAME := $(shell cat .python-version)
test:
python setup.py test
setup-venv: _install_python_version _install_virtualenv _install_pkg
_install_python_version:
# Ensures that the version of python required by CMP is installed
echo "-- Checking python pyenv $ installation..."
if pyenv versions | grep -q $(PYTHON_VERSION); then \
echo "- python $(PYTHON_VERSION) installation was found in pyenv"; \
else \
echo "- python $(PYTHON_VERSION) installation was not found in pyenv, installing it..."; \
pyenv install $(PYTHON_VERSION); \
fi
_install_virtualenv:
# Resets the CMP virtual env
echo "-- Installing virtual env..."
echo "- Uninstalling previous venv..."
pyenv uninstall -f $(VENV_NAME)
echo "- Installing venv..."
pyenv virtualenv $(PYTHON_VERSION) $(VENV_NAME)
echo "- Upgrading pip..."
pip install --upgrade pip
_install_pkg:
echo "Installing cmp packages and dependencies..."
pip install -r requirements_dev.txt