-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
31 lines (25 loc) · 868 Bytes
/
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
# to create development environment: `make`
# to run pre-commit linting/formatting: `make lint`
VENVDIR=venv
VENVBIN=$(VENVDIR)/bin
VENVDONE=$(VENVDIR)/.done
## run pre-commit checks on all files
lint: $(VENVDONE)
$(VENVBIN)/pre-commit run --all-files
# create venv with project dependencies
# --editable skips installing project sources in venv
# pre-commit is in dev optional-requirements
$(VENVDONE): $(VENVDIR) Makefile pyproject.toml
$(VENVBIN)/python3 -m pip install --editable '.[dev]'
$(VENVBIN)/pre-commit install
touch $(VENVDONE)
$(VENVDIR):
python3 -m venv $(VENVDIR)
## update .pre-commit-config.yaml
update: $(VENVDONE)
$(VENVBIN)/pre-commit autoupdate
## clean up development environment
clean:
-$(VENVBIN)/pre-commit clean
rm -rf $(VENVDIR) build sitemap_tools.egg-info .pre-commit-run.sh.log \
mc_sitemap_tools/__pycache__ .mypy_cache