-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
81 lines (57 loc) · 1.97 KB
/
Makefile
File metadata and controls
81 lines (57 loc) · 1.97 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
.PHONY: help tag release install-local test
.DEFAULT_GOAL := help
TEST_RESULTS := test_results
SYSTEM_PYTHON := python
VERSION := $$(hatch version)
TAG := v$(VERSION)
define BROWSER_PYSCRIPT
import os, webbrowser, sys
try:
from urllib import pathname2url
except:
from urllib.request import pathname2url
webbrowser.open("file://" + pathname2url(os.path.abspath(sys.argv[1])))
endef
export BROWSER_PYSCRIPT
BROWSER := $(SYSTEM_PYTHON) -c "$$BROWSER_PYSCRIPT"
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) \
| awk 'BEGIN {FS = ":.*?## "}; \
{printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
tag: ## create and push a tag for the current version
git tag $(TAG)
git push origin $(TAG)
release: ## package and upload a release
@echo "For further usage."
install-local: ## install scaffold locally
@echo "Make sure you activated the virtual env with: 'source .venv/bin/activate'"
python -m pip install --upgrade pip
pip install -e .
test: ## runs tests
@pytest -s -vvv
coverage: ## run tests with coverage
@pytest --cov=pygithubactions
create-results: ## create test_results directory
mkdir -p $(TEST_RESULTS)
coverage-output: ## create outputs for coverage reports
@coverage html -d $(TEST_RESULTS)
coverage-report: create-results coverage coverage-output ## run coverage, generate report, open in the browser
$(SYSTEM_PYTHON) -m webbrowser -t "file://$(PWD)/$(TEST_RESULTS)/index.html"
coverage-clean: ## remove the coverage directory
rm -rf $(TEST_RESULTS)
rm .coverage
isort: ## runs isort
@isort .
format: isort ## formats python
@blue .
lint: format ## run python flake8 linter tool
@ruff .
static-check: ## runs static checks with mypy
@mypy pygithubactions
precommit-install: ## install pre-commit
@pre-commit install
precommit-run: ## run all pre-commit hooks
@pre-commit run -a
clean: ## run clean up
rm -rf .pytest_cache dist build yamlvalidator.egg-info .pytest_cache .mypy_cache test_results .coverage
find . -type d -name '__pycache__' -exec rm -r {} +