forked from nomic-ai/nomic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
54 lines (37 loc) · 1.41 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
52
53
54
SHELL:=/bin/bash -o pipefail
ROOT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
PYTHON:=python3
all: venv
source env/bin/activate; python -m pip install --upgrade pip
source env/bin/activate; pip install -e .
venv:
if [ ! -d $(ROOT_DIR)/env ]; then $(PYTHON) -m venv $(ROOT_DIR)/env; fi
dev: all
source env/bin/activate; pip install -e ".[dev]"
black:
source env/bin/activate; black -l 120 -S --target-version py36 nomic
isort:
source env/bin/activate; isort --ignore-whitespace --atomic -w 120 nomic
pyright:
source env/bin/activate; pyright nomic/ -p .
documentation:
source env/bin/activate; rm -rf /.site && mkdocs build
pypi:
source env/bin/activate; python setup.py sdist; twine upload dist/*; rm -rf dist/
lint: black isort pyright
@echo "Lint checks passed!"
pretty: isort black
test:
source env/bin/activate; pytest -s tests
clean:
rm -rf {.pytest_cache,env,nomic.egg-info}
find . | grep -E "(__pycache__|\.pyc|\.pyo$\)" | xargs rm -rf
ci_venv:
if [ ! -d $(ROOT_DIR)/ci_venv ]; then $(PYTHON) -m venv $(ROOT_DIR)/ci_venv; fi
source ci_venv/bin/activate; pip install -r ci_venv_requirements.txt
black_ci:
source env/bin/activate; black --check --diff -l 120 -S --target-version py36 nomic
isort_ci:
source env/bin/activate; isort --check --diff --skip env --skip env --profile black --ignore-whitespace --atomic -w 120 nomic
pyright_ci:
source env/bin/activate; pyright nomic/ -p .