-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
51 lines (42 loc) · 1.11 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
.PHONY: init create update test destroy deploy
.DEFAULT: help
help:
@echo "make init"
@echo " initialize dev environment."
@echo "make create"
@echo " create env and install dependencies."
@echo "make update"
@echo " update dependency versions"
@echo "make test"
@echo " run module tests"
@echo "make destroy"
@echo " delete the current environment to start fresh"
@echo "make deploy"
@echo " upload package to pypi"
ENV=xleaf
PYTHON_VERSION=3.9
ENV_CONDA=conda run -n ${ENV} --no-capture-output
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
CONDA_LOCK=conda-linux-64.lock
endif
ifeq ($(UNAME_S),Darwin)
CONDA_LOCK=conda-osx-arm64.lock
endif
init:
conda-lock --mamba -f environment.yaml -k explicit
create:
conda create -n ${ENV} --file ${CONDA_LOCK}
${ENV_CONDA} pip install -e .
${ENV_CONDA} pre-commit install
update:
conda-lock --mamba -f environment.yaml -k explicit
${ENV_CONDA} conda update --file ${CONDA_LOCK}
test:
${ENV_CONDA} pytest -n auto
destroy:
conda env remove -n ${ENV}
deploy:
rm -rf dist/
${ENV_CONDA} python3 setup.py sdist bdist_wheel
${ENV_CONDA} twine upload dist/*