forked from better/jsonschema2db
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
56 lines (41 loc) · 1.44 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
.DEFAULT_GOAL := precommit
.PHONY: help
help: ## show help message
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n \033[36m\033[0m\n"} /^[$$()% a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
.PHONY: install
install: ## Install project using poetry
poetry install
.PHONY: lint
lint: ## Perform linting and formatting
@echo "Formatting with black"
@poetry run black .
@echo "Check for errors with flake8"
@poetry run flake8 ./
.PHONY: test
test: ## Run tests
@poetry run pytest --cov=jsonschema2ddl -v test/
POETRY_EXTRA_ARGS ?=
.PHONY: version
version: ## Upload a new version to PyPI
@poetry version $(shell git describe --tags --abbrev=0) && poetry publish --username ${PYPI_USER} --password ${PYPI_PASS} --build $(POETRY_EXTRA_ARGS)
.PHONY: docs
docs: ## Produce documentation
@poetry run $(MAKE) -s -C docs clean
@poetry run $(MAKE) -s -C docs html
.PHONY: clean
clean: ## Remove build artifacts
@rm -fr build/
@rm -fr dist/
@rm -fr .eggs/
@find . -name '*.egg-info' -exec rm -fr {} +
@find . -name '*.egg' -exec rm -f {} +
@find . -name '*.pyc' -exec rm -f {} +
@find . -name '*.pyo' -exec rm -f {} +
@find . -name '__pycache__' -exec rm -fr {} +
@rm -fr .tox/
@rm -f .coverage
@rm -fr htmlcov/
@rm -fr .pytest_cache
@$(MAKE) -s -C docs clean
.PHONY: precommit
precommit: setup clean lint test docs ## Actions befor a commit