-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
44 lines (30 loc) · 1.07 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
SRCDIRS := src/quantifiedme tests
SRCFILES := $(shell find $(SRCDIRS) -name '*.py')
# today
date := $(shell date +%Y-%m-%d)
all: notebooks
notebooks: notebooks/output/Dashboard.html
notebooks/output/Dashboard.html:
env PERSONAL=false FAST=true make -C notebooks build
dashboard: dashboard/build/dashboard.html
dashboard/build/dashboard.html:
poetry run python3 dashboard/build_dashboard.py
install:
poetry install
lint:
poetry run ruff $(SRCDIRS)
fmt:
poetry run ruff --fix $(SRCDIRS)
poetry run pyupgrade --py310-plus $(SRCFILES) --exit-zero-even-if-changed
poetry run black $(SRCDIRS)
test:
poetry run python3 -m pytest -v tests/ --durations=5 $(if $(NOCAPTURE),--capture=no) \
--cov=quantifiedme --cov-report xml --cov-report term-missing \
$(if $(SLOW),,-m "not slow") \
$(if $(PROFILE),--profile-svg)
typecheck:
poetry run mypy --ignore-missing-imports --check-untyped-defs $(SRCDIRS)
precommit: fmt typecheck test
jupyter:
# From: https://stackoverflow.com/a/47296960/965332
poetry run bash -c 'python -m ipykernel install --user --name=`basename $$VIRTUAL_ENV`'