chore: enhance python.mk (#1474)
* chore: run pylint with multiple cpu * chore: use .venv as dev venv dir
This commit is contained in:
parent
4a7f2290f1
commit
5b1e61a13e
|
@ -17,13 +17,13 @@ SHARED_DEV_REQUIREMENTS = \
|
||||||
pytest-cov \
|
pytest-cov \
|
||||||
pytest-xdist
|
pytest-xdist
|
||||||
|
|
||||||
VENV = venv
|
VENV = .venv
|
||||||
$(VENV):
|
$(VENV):
|
||||||
python3 -m venv $(VENV)
|
python3 -m venv $(VENV)
|
||||||
source $(VENV)/bin/activate
|
source $(VENV)/bin/activate
|
||||||
$(MAKE) install
|
$(MAKE) install
|
||||||
|
|
||||||
install: venv
|
install: $(VENV)
|
||||||
source $(VENV)/bin/activate
|
source $(VENV)/bin/activate
|
||||||
pip install --upgrade pip setuptools wheel
|
pip install --upgrade pip setuptools wheel
|
||||||
pip install $(SHARED_DEV_REQUIREMENTS) $(PIP_INSTALL)
|
pip install $(SHARED_DEV_REQUIREMENTS) $(PIP_INSTALL)
|
||||||
|
@ -43,7 +43,7 @@ install: venv
|
||||||
.PHONY: .pylint
|
.PHONY: .pylint
|
||||||
.pylint: $(VENV)
|
.pylint: $(VENV)
|
||||||
source $(VENV)/bin/activate
|
source $(VENV)/bin/activate
|
||||||
pylint --output-format=colorized $(PYLINT_ARG) || true
|
pylint --jobs=$(CPU_CORES) --output-format=colorized $(PYLINT_ARG) || true
|
||||||
|
|
||||||
.PHONY: .mypy
|
.PHONY: .mypy
|
||||||
.mypy: $(VENV)
|
.mypy: $(VENV)
|
||||||
|
@ -52,7 +52,7 @@ install: venv
|
||||||
|
|
||||||
.PHONY: .pytest
|
.PHONY: .pytest
|
||||||
.pytest: $(VENV)
|
.pytest: $(VENV)
|
||||||
source venv/bin/activate
|
source $(VENV)/bin/activate
|
||||||
pytest -n $(CPU_CORES) --color=yes -v $(PYTEST_ARG)
|
pytest -n $(CPU_CORES) --color=yes -v $(PYTEST_ARG)
|
||||||
|
|
||||||
.PHONY: .clean
|
.PHONY: .clean
|
||||||
|
|
Loading…
Reference in New Issue