-
Notifications
You must be signed in to change notification settings - Fork 97
/
Makefile
86 lines (69 loc) · 2.31 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
PYTHON?=python -X dev
NIX?=nix --extra-experimental-features nix-command --extra-experimental-features flakes
all: help
help: ## Show this help
@echo -e "Specify a command. The choices are:\n"
@grep -E '^[0-9a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[0;36m%-18s\033[m %s\n", $$1, $$2}'
@echo ""
.PHONY: help
shell-completion: ## Generate shell completion scripts
make -C scripts/shell_completion
.PHONY: shell-completion
update-authors: ## Generate AUTHORS file from git commits
git shortlog -s -e -n | \
sed -e "s/\t/ /" | \
sed -e "s/^\s*//" > \
AUTHORS
.PHONY: update-authors
tags: ## Generate ctags for main codebase
ctags -f tags \
--recurse=yes \
--tag-relative=yes \
--fields=+l \
--kinds-python=-i \
--language-force=python \
papis
.PHONY: tags
doc: ## Generate the documentation in doc/
cd doc && rm -rf build && make html SPHINXOPTS="-W --keep-going -n" || true
@echo ""
@echo -e "\e[1;32mRun '$$BROWSER doc/build/html/index.html' to see the docs\e[0m"
@echo ""
.PHONY: doc
pytest: ## Run pytest tests and doctests
$(PYTHON) -m pytest papis tests
.PHONY: pytest
flake8: ## Run flake8 (style checks)
$(PYTHON) -m flake8 papis tests examples
.PHONY: flake8
mypy: ## Run mypy (type annotations)
$(PYTHON) -m mypy papis
.PHONY: mypy
codespell: ## Run codespell (spellchecking)
@codespell --summary \
--skip build --skip resources --skip data --skip LTWA.json \
--uri-ignore-words-list '*' \
--ignore-words .codespell-ignore \
contrib doc examples papis scripts tests tools
.PHONY: codespell
ci-install: ## Install dependencies like on the CI
bash tools/ci-install.sh
.PHONY: ci-install
ci-test: ## Run tests like on the CI
bash tools/ci-run-test.sh
.PHONY: ci-test
ci-lint: ## Run linting like on the CI
bash tools/ci-run-lint.sh
.PHONY: ci-lint
nix-build: ## Build using nix
$(NIX) build
.PHONY: nix-build
nix-update: ## Update the nix flake.lock file
$(NIX) flake update
.PHONY: nix-update
nix-test: ## Run the tests within nix
$(NIX) develop --command bash -c "source .venv/bin/activate; python -m pytest -v papis tests"
.PHONY: nix-update
nix-install: ## Install nix flake to local profile
$(NIX) profile install '.#papis'
.PHONY: nix-install