-
Notifications
You must be signed in to change notification settings - Fork 67
/
Makefile
64 lines (48 loc) · 1.12 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
55
56
57
58
59
60
61
62
63
64
PROJECT_NAME := pfhedge
RUN := poetry run
.PHONY: check
check: test lint-pysen
.PHONY: install
install:
@poetry install
.PHONY: test
test: doctest pytest
.PHONY: doctest
doctest:
$(RUN) pytest --doctest-modules $(PROJECT_NAME) -m "not gpu"
.PHONY: pytest
pytest:
$(RUN) pytest --doctest-modules tests -m "not gpu"
.PHONY: test-cov
test-cov:
$(RUN) pytest --cov=$(PROJECT_NAME) --cov-report=xml -m "not gpu"
.PHONY: lint
lint: lint-black lint-isort flake8 mypy
.PHONY: lint-black
lint-black:
$(RUN) black --check --diff --quiet --skip-magic-trailing-comma .
.PHONY: lint-isort
lint-isort:
$(RUN) isort --check --force-single-line-imports --quiet .
.PHONY: mypy
mypy:
$(RUN) mypy $(PROJECT_NAME)
.PHONY: flake8
flake8:
$(RUN) pflake8 $(PROJECT_NAME)
.PHONY: format
format: format-black format-isort
.PHONY: format-black
format-black:
$(RUN) black --quiet .
.PHONY: format-isort
format-isort:
$(RUN) isort --force-single-line-imports --quiet .
.PHONY: doc
doc:
@cd docs && make html
.PHONY: publish
publish:
@git checkout main
@gh repo sync simaki/$(PROJECT_NAME)
@gh workflow run publish.yml --repo simaki/$(PROJECT_NAME)