-
Notifications
You must be signed in to change notification settings - Fork 21
/
Makefile
53 lines (40 loc) · 1.63 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
.PHONY: build clean-pyc init help test-ci
.DEFAULT_GOAL := help
help: ## See what commands are available.
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36mmake %-15s\033[0m # %s\n", $$1, $$2}'
init: clean-pyc ## Install dependencies and initialise for development.
pip install --upgrade pip setuptools wheel twine
pip install -e .
pip install -r requirements.txt
nvm use
npm install
lint: ## Lint the project.
ruff check
ruff format --diff
mypy **/*.py
format: ## Format project files.
ruff format
npm run format
test: ## Test the project.
PYTHONDEVMODE=1 pytest -W error --capture=no
test-watch: ## Restarts the tests whenever a file changes.
PYTHONDEVMODE=1 nodemon -q -e py -w tests -w draftjs_exporter -x "clear && make test -s || true"
test-coverage: ## Run the tests while generating test coverage data.
PYTHONDEVMODE=1 pytest -W error --cov --cov-report=html --capture=no
test-ci: ## Continuous integration test suite.
tox
dev: ## Restarts the example whenever a file changes.
nodemon -q -e py -w tests -w draftjs_exporter -w example.py -x "clear && python -X dev -W error example.py || true"
benchmark: ## Runs a one-off performance (speed, memory) benchmark.
python benchmark.py
python -m memray summary benchmark.bin
python -m memray stats benchmark.bin
clean-pyc: ## Remove Python file artifacts.
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
build: ## Builds package for publication.
rm -f dist/*
python -X dev -W error -m build
publish: build ## Publishes a new version to PyPI.
twine upload dist/*