-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
39 lines (33 loc) · 1.1 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
SHELL = /bin/zsh -i
NAME := mms_magnetotail_survey
MAMBA := $(shell command -v micromamba 2> /dev/null)
INSTALL_STAMP := .install.stamp
CONDA_LOCK := conda-linux-64.lock
POETRY_LOCK := poetry.lock
.DEFAULT_GOAL := help
.PHONY: help
help:
@echo "TODO: Edit help string"
@echo $(POETRY)
install: $(INSTALL_STAMP)
$(INSTALL_STAMP): pyproject.toml $(POETRY_LOCK) $(CONDA_LOCK)
@if [ -z $(MAMBA) ]; then \
echo "Micromamba not found. See https://mamba.readthedocs.io/en/latest/installation.html for installation."; \
exit 1; \
fi
@echo "Creating virtual environment from $(CONDA_LOCK) ..."
@micromamba create --quiet --yes --override-channels --name ${NAME} --file conda-linux-64.lock
@echo "Installing packages from $(POETRY_LOCK) ..."
@micromamba run -n ${NAME} poetry install
@micromamba run -n ${NAME} pip install spacepy --no-build-isolation
@touch $(INSTALL_STAMP)
@echo "Done installation!"
.PHONY: format
format:
poetry run isort src/ scripts/
poetry run black -l 79 src/
poetry run black -l 120 scripts/
.PHONY: clean
clean:
find . -type d -name "__pycache__" | xargs rm -rf {};
rm -rf $(INSTALL_STAMP)