-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
35 lines (31 loc) · 1002 Bytes
/
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
NAME := tvolib
MICROMAMBA := $(shell command -v micromamba 2> /dev/null)
CONDA_LOCK := conda-lock.yml
POETRY_LOCK := poetry.lock
.DEFAULT_GOAL := help
.PHONY: help
help:
@echo "Edit help string"
.PHONY: install
install: pyproject.toml ${POETRY_LOCK} ${CONDA_LOCK}
@if [ -z ${MICROMAMBA} ]; then \
echo "Micromamba binary not found!"; \
echo "See the README or https://mamba.readthedocs.io/en/latest/installation/micromamba-installation.html for installation instruction."; \
exit 1; \
fi
@echo "Conda: Creating virtual environment from ${CONDA_LOCK} ..."
@${MICROMAMBA} create \
--yes \
--override-channels \
--name ${NAME} \
--file ${CONDA_LOCK}
@echo "Poetry: Installing packages from ${POETRY_LOCK} ..."
@${MICROMAMBA} run -n ${NAME} poetry install
@echo "Done installation!"
.PHONY:
format:
${MICROMAMBA} run -n ${NAME} poetry run isort src/
${MICROMAMBA} run -n ${NAME} poetry run black src/
.PHONY: clean
clean:
find . -type d -name "__pycache__" | xargs rm -rf {};