-
Notifications
You must be signed in to change notification settings - Fork 14
/
Makefile
35 lines (26 loc) · 1017 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
SHELL := /bin/bash
ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
VENV_PRE_COMMIT := ${ROOT_DIR}/venv/.pre_commit
VENV_DOCS_REBUILD := ${ROOT_DIR}/venv/.docs_rebuild
.PHONY: all
all: ${VENV_PRE_COMMIT}
.PHONY: py
py: ${VENV_PYTHON_PACKAGES}
bash -c 'source venv/bin/activate'
VENV_INITIALIZED := venv/.initialized
${VENV_INITIALIZED}:
rm -rf venv && python3 -m venv venv
@touch ${VENV_INITIALIZED}
VENV_PYTHON_PACKAGES := venv/.python_packages
${VENV_PYTHON_PACKAGES}: ${VENV_INITIALIZED}
bash -c 'source venv/bin/activate && python -m pip install --upgrade pip setuptools'
bash -c 'source venv/bin/activate && python -m pip install -e core/py'
bash -c 'source venv/bin/activate && python -m pip install -e py[all]'
@touch $@
${VENV_PRE_COMMIT}: ${VENV_PYTHON_PACKAGES}
bash -c 'source venv/bin/activate && pre-commit install'
@touch $@
develop: ${VENV_PRE_COMMIT}
@echo "--\nRun "source env.sh" to enter development mode!"
fixup:
source env.sh && pre-commit run --all-files