-
Notifications
You must be signed in to change notification settings - Fork 21
/
Makefile
43 lines (30 loc) · 1.01 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
SHELL := /bin/bash
ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
VENV_PRE_COMMIT := ${ROOT_DIR}/venv/.pre_commit
.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 build twine openai'
bash -c 'source venv/bin/activate && python -m pip install -e ".[dev]"'
@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:
pre-commit run --all-files
.PHONY: test test-py test-js
test: test-py test-js
test-py:
source env.sh && python3 -m pytest
test-js:
npm install && npm run test