Use shared python makefile and start linting
Always update setuptools/wheel/pip Never fail while linting We use github annotations to impove the code incrementally.
This commit is contained in:
parent
0d88d17f7c
commit
ceb40ee216
7 changed files with 81 additions and 46 deletions
29
tools/python.mk
Normal file
29
tools/python.mk
Normal file
|
@ -0,0 +1,29 @@
|
|||
.ONESHELL:
|
||||
|
||||
SHELL := bash
|
||||
CPU_CORES := $(shell nproc)
|
||||
|
||||
# PIP_INSTALL := --editable .[dev]
|
||||
# PYLINT_ARG :=
|
||||
# PYTEST_ARG :=
|
||||
|
||||
VENV := venv
|
||||
$(VENV):
|
||||
python3 -m venv $(VENV)
|
||||
source $(VENV)/bin/activate
|
||||
pip install --upgrade pip setuptools wheel
|
||||
pip install $(PIP_INSTALL)
|
||||
|
||||
.PHONY: .pylint
|
||||
.pylint: $(VENV)
|
||||
source $(VENV)/bin/activate
|
||||
pylint --output-format=colorized $(PYLINT_ARG) || true
|
||||
|
||||
.PHONY: .pytest
|
||||
.pytest: $(VENV)
|
||||
source venv/bin/activate
|
||||
pytest -n $(CPU_CORES) --color=yes -v $(PYTEST_ARG)
|
||||
|
||||
.PHONY: .clean
|
||||
.clean:
|
||||
rm -Rf $(VENV)
|
Loading…
Add table
Add a link
Reference in a new issue