-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
64 lines (54 loc) · 2.18 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
.PHONY: virtualenv setup_venv uninstall_proactive install_latest install_latest_test install_latest_local run_all print_version help
PYTHON_SDK_HOME="../proactive-python-client"
PYTHON=python3
setup_venv:
@echo "Setting up virtual environment..."
@$(PYTHON) -m venv env
@. env/bin/activate && $(PYTHON) -m pip install --upgrade pip setuptools python-dotenv humanize
@. env/bin/activate && $(PYTHON) -m pip -V
@echo "Virtual environment is ready."
virtualenv:
@if [ -d "env" ]; then \
echo "Virtual environment already exists."; \
read -p "Do you want to delete it and create a new one? [y/N] " answer; \
case $$answer in \
[Yy]* ) \
echo "Deleting and recreating the virtual environment..."; \
rm -rf env; \
$(MAKE) setup_venv;; \
* ) \
echo "Using the existing virtual environment.";; \
esac \
else \
$(MAKE) setup_venv; \
fi
uninstall_proactive:
@echo "Uninstalling proactive package..."
@. env/bin/activate && $(PYTHON) -m pip uninstall -y proactive
@echo "Proactive package uninstalled."
install_latest: uninstall_proactive
@echo "Installing the latest pre-release of proactive..."
@. env/bin/activate && $(PYTHON) -m pip install --upgrade --pre proactive
@echo "Latest pre-release of proactive installed."
install_latest_test: uninstall_proactive
@echo "Installing the latest test version of proactive from TestPyPI..."
@. env/bin/activate && $(PYTHON) -m pip install --upgrade --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple --pre proactive
@echo "Latest test version of proactive installed."
install_latest_local: uninstall_proactive
@echo "Installing the latest local version of proactive..."
@. env/bin/activate; for zip in $(PYTHON_SDK_HOME)/dist/*.zip; do \
python -m pip install "$$zip"; \
done
@echo "Latest local version of proactive installed."
run_all:
@echo "Running all Python scripts..."
@. env/bin/activate && for file in *.py; do \
echo "Running $$file..."; \
$(PYTHON) $$file; \
done
@echo "All Python scripts have been run."
print_version:
@. env/bin/activate && $(PYTHON) -m pip show proactive
@. env/bin/activate && $(PYTHON) -c "import proactive; print(proactive.__version__)"
help:
@cat Makefile