-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathmakefile
More file actions
119 lines (99 loc) · 3.21 KB
/
makefile
File metadata and controls
119 lines (99 loc) · 3.21 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
.ONESHELL:
SHELL := /bin/bash
SRC = pymusas
DOCS_API_DIR = ./docs/docs/api
DOCS_SRC_TMP = $(filter-out $(SRC)/__main__.py %/__init__.py ,$(shell find $(SRC) -type f -name '*.py'))
DOCS_SRC = $(subst .py,,$(subst /,.,${DOCS_SRC_TMP}))
VERSION_CMD = "uv run scripts/get_version.py ./pyproject.toml"
.PHONY: develop-docs
develop-docs: install-package-for-docs
@cd docs
@yarn start -h "0.0.0.0"
.PHONY: remove-built-docs
remove-built-docs:
@cd docs
@rm -rf build
docs/build: install-package-for-docs remove-built-docs
@cd docs
@rm -rf build
@yarn build
.PHONY: serve-built-docs
serve-built-docs: install-package-for-docs docs/build
@cd docs
@yarn serve -h 0.0.0.0
.PHONY: install-package-for-docs
install-package-for-docs:
@cd docs
@yarn install
.PHONY: create-api-docs
create-api-docs:
@rm -rf ${DOCS_API_DIR}
@./scripts/py2md.py ${DOCS_SRC}
.PHONY: create-docs
create-docs:
@npx create-docusaurus@latest new_docs classic --typescript
@rm -rf ./new_docs/docs ./new_docs/blog ./new_docs/static/img ./new_docs/src/pages
@mkdir ./new_docs/static/img
@cp -r ./docs/static/img/* ./new_docs/static/img/.
@cp ./docs/docusaurus.config.ts ./new_docs/.
@cp ./docs/sidebars.ts ./new_docs/.
@cp -r ./docs/docs ./new_docs/.
@rm -rf ./docs
@mv ./new_docs ./docs
.PHONY: build-python-package
build-python-package:
@uv lock --check
@rm -rf ./dist
@uv build
.PHONY: release-notes
release-notes: build-python-package
@uv run --no-project --script \
--with dist/pymusas-$$("${VERSION_CMD}")-py3-none-any.whl \
./scripts/release_notes.py
.PHONY: lint
lint:
@echo "ISort:"
@uv run isort pymusas tests scripts benchmarks
@echo "Falke 8:"
@uv run flake8 --config ./.flake8 pymusas/** tests/** scripts/** benchmarks/**
@echo "MyPy:"
@uv run mypy
@echo "Linting finished"
.PHONY: tests
tests:
@uv run coverage run
@uv run coverage report
.PHONY: failed-tests
failed-tests:
@uv run pytest --last-failed -vvv
.PHONY: verbose-tests
verbose-tests:
@uv run pytest -vvv
.PHONY: doc-tests
doc-tests:
@uv run coverage run -m pytest --doctest-modules pymusas/
@uv run coverage report
.PHONY: full-coverage-tests
full-coverage-tests:
@uv run scripts/create_temporary_version.py ./pyproject.toml ./temp_pyproject.toml
@uv lock --check
@rm -rf ./dist
@uv build
@uv run coverage erase
@uv run --with dist/pymusas-$$("${VERSION_CMD}")-py3-none-any.whl \
--with "pytest<9.0.2" --with "coverage>=6.0.0" --no-project --isolated \
coverage run --append -m pytest tests/functional_tests
@uv run --with dist/pymusas-$$("${VERSION_CMD}")-py3-none-any.whl[neural] \
--index https://download.pytorch.org/whl/cpu \
--with "pytest<9.0.2" --with "coverage>=6.0.0" --no-project --isolated \
coverage run --append -m pytest tests/functional_tests
@uv run --with dist/pymusas-$$("${VERSION_CMD}")-py3-none-any.whl[neural] \
--index https://download.pytorch.org/whl/cpu \
--with "pytest<9.0.2" --with "coverage>=6.0.0" --no-project --isolated \
coverage run --append -m pytest --doctest-modules pymusas/
@uv run --with dist/pymusas-$$("${VERSION_CMD}")-py3-none-any.whl[neural,dev] \
--index https://download.pytorch.org/whl/cpu \
--no-project --isolated coverage run --append
@uv run coverage report
@mv ./temp_pyproject.toml ./pyproject.toml
@rm -rf ./dist