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
|
@ -0,0 +1,9 @@
|
||||||
|
all: lint
|
||||||
|
|
||||||
|
include ../tools/python.mk
|
||||||
|
|
||||||
|
PIP_INSTALL := --editable .[dev]
|
||||||
|
PYLINT_ARG := libretimeapi
|
||||||
|
|
||||||
|
lint: .pylint
|
||||||
|
clean: .clean
|
|
@ -0,0 +1,9 @@
|
||||||
|
all: lint
|
||||||
|
|
||||||
|
include ../../tools/python.mk
|
||||||
|
|
||||||
|
PIP_INSTALL := --editable .[dev]
|
||||||
|
PYLINT_ARG := airtime-celery
|
||||||
|
|
||||||
|
lint: .pylint
|
||||||
|
clean: .clean
|
|
@ -1,19 +1,15 @@
|
||||||
.PHONY: lint test
|
all: lint test
|
||||||
|
|
||||||
SHELL := bash
|
include ../../tools/python.mk
|
||||||
CPU_CORES := $(shell nproc)
|
|
||||||
|
|
||||||
MODULE_APP := airtime_analyzer
|
PIP_INSTALL := --editable .[dev]
|
||||||
MODULE_TESTS := tests
|
PYLINT_ARG := airtime_analyzer tests
|
||||||
|
PYTEST_ARG := --cov=airtime_analyzer tests
|
||||||
|
|
||||||
lint:
|
lint: .pylint
|
||||||
pylint ${MODULE_APP}
|
|
||||||
pylint ${MODULE_TESTS}
|
|
||||||
|
|
||||||
fixtures:
|
fixtures:
|
||||||
bash tests/fixtures/generate.sh
|
bash tests/fixtures/generate.sh
|
||||||
|
|
||||||
test: fixtures
|
test: fixtures .pytest
|
||||||
pytest -n ${CPU_CORES} --color=yes -v --cov=${MODULE_APP} ${MODULE_TESTS}
|
clean: .clean
|
||||||
|
|
||||||
all: lint test
|
|
||||||
|
|
|
@ -1,16 +1,11 @@
|
||||||
.PHONY: lint test
|
|
||||||
|
|
||||||
SHELL := bash
|
|
||||||
CPU_CORES := $(shell nproc)
|
|
||||||
|
|
||||||
MODULE_APP := api_clients
|
|
||||||
MODULE_TESTS := tests
|
|
||||||
|
|
||||||
lint:
|
|
||||||
pylint ${MODULE_APP}
|
|
||||||
pylint ${MODULE_TESTS}
|
|
||||||
|
|
||||||
test:
|
|
||||||
pytest -n ${CPU_CORES} --color=yes -v --cov=${MODULE_APP} ${MODULE_TESTS}
|
|
||||||
|
|
||||||
all: lint test
|
all: lint test
|
||||||
|
|
||||||
|
include ../../tools/python.mk
|
||||||
|
|
||||||
|
PIP_INSTALL := --editable .[dev]
|
||||||
|
PYLINT_ARG := api_clients tests
|
||||||
|
PYTEST_ARG := --cov=api_clients tests
|
||||||
|
|
||||||
|
lint: .pylint
|
||||||
|
test: .pytest
|
||||||
|
clean: .clean
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
all: lint
|
||||||
|
|
||||||
|
include ../../tools/python.mk
|
||||||
|
|
||||||
|
PIP_INSTALL := --editable .[dev]
|
||||||
|
PYLINT_ARG := liquidsoap pypo
|
||||||
|
|
||||||
|
lint: .pylint
|
||||||
|
clean: .clean
|
|
@ -1,23 +1,11 @@
|
||||||
.PHONY: lint test
|
|
||||||
.ONESHELL:
|
|
||||||
|
|
||||||
SHELL := bash
|
|
||||||
CPU_CORES := $(shell nproc)
|
|
||||||
|
|
||||||
all: lint test
|
all: lint test
|
||||||
|
|
||||||
venv:
|
include python.mk
|
||||||
python3 -m venv venv
|
|
||||||
source venv/bin/activate
|
|
||||||
pip install -r requirements-dev.txt
|
|
||||||
|
|
||||||
lint: venv
|
PIP_INSTALL := -r requirements-dev.txt
|
||||||
source venv/bin/activate
|
PYLINT_ARG := tools
|
||||||
pylint tools
|
PYTEST_ARG := .
|
||||||
|
|
||||||
test: venv
|
lint: .pylint
|
||||||
source venv/bin/activate
|
test: .pytest
|
||||||
pytest -n ${CPU_CORES} --color=yes -v .
|
clean: .clean
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -Rf venv
|
|
||||||
|
|
|
@ -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…
Reference in New Issue