From 8d72f43c7dbfe22641e8195aa3c14beb665bb015 Mon Sep 17 00:00:00 2001 From: Maksim Beliaev Date: Sat, 3 Sep 2022 12:07:22 +0200 Subject: [PATCH 1/4] remove redundant commands from Makefile --- Makefile | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/Makefile b/Makefile index 15a0ba57..3e3bddd1 100644 --- a/Makefile +++ b/Makefile @@ -1,30 +1,21 @@ - export POETRY_VIRTUALENVS_IN_PROJECT=true EXTRAS ?= develop SPHINXOPTS ?= -n -.venv/.st-venv-completed: - poetry install --verbose --with $(EXTRAS) - touch .venv/.st-venv-completed - -.PHONY: venv -venv: .venv/.st-venv-completed .PHONY: dev -dev: venv +dev: + poetry install --verbose --with $(EXTRAS) + touch .venv/.st-venv-completed .PHONY: precommit -precommit: venv +precommit: dev poetry run pre-commit run -a .PHONY: mypy -mypy: venv +mypy: dev .venv/bin/mypy -.PHONY: autoformat -autoformat: dev - .venv/bin/autopep8 --in-place --recursive pytest_httpserver tests - .PHONY: mrproper mrproper: clean rm -rf dist @@ -34,7 +25,7 @@ clean: cov-clean doc-clean rm -rf .venv *.egg-info build .eggs __pycache__ */__pycache__ .tox .PHONY: test -test: venv +test: dev .venv/bin/pytest tests -s -vv .venv/bin/pytest tests -s -vv --ssl @@ -53,7 +44,7 @@ cov-clean: rm -rf htmlcov coverage.xml .coverage .PHONY: doc -doc: .venv +doc: dev .venv/bin/sphinx-build -M html doc doc/_build $(SPHINXOPTS) $(O) .PHONY: doc-clean @@ -61,7 +52,7 @@ doc-clean: rm -rf doc/_build .PHONY: changes -changes: venv +changes: dev .venv/bin/reno report --output CHANGES.rst --no-show-source poetry run pre-commit run --files CHANGES.rst || true poetry run pre-commit run --files CHANGES.rst From f8e5943e9d14448d674d69b0e9a15a8e8a7c4e9d Mon Sep 17 00:00:00 2001 From: Maksim Beliaev Date: Sat, 3 Sep 2022 15:38:16 +0200 Subject: [PATCH 2/4] make target dependent on poetry.lock and pyproject.toml --- Makefile | 9 ++++++--- pyproject.toml | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index a91a1434..d0bdc40e 100644 --- a/Makefile +++ b/Makefile @@ -2,12 +2,15 @@ export POETRY_VIRTUALENVS_IN_PROJECT=true EXTRAS ?= develop SPHINXOPTS ?= -n - -.PHONY: dev -dev: +.venv/.st-venv-completed: poetry.lock pyproject.toml poetry install --verbose --with $(EXTRAS) touch .venv/.st-venv-completed + +.PHONY: dev +dev: .venv/.st-venv-completed + + .PHONY: precommit precommit: dev poetry run pre-commit run -a diff --git a/pyproject.toml b/pyproject.toml index 63c3e080..ecdbc491 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -92,3 +92,4 @@ markers = [ [tool.mypy] files = ["pytest_httpserver", "scripts", "tests", "doc"] implicit_reexport = false + From 9f54082a62fbdb32cd9b0a245d6b6681cc63dc5a Mon Sep 17 00:00:00 2001 From: Maksim Beliaev Date: Sat, 3 Sep 2022 15:40:02 +0200 Subject: [PATCH 3/4] comment --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d0bdc40e..620b55a8 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,8 @@ export POETRY_VIRTUALENVS_IN_PROJECT=true EXTRAS ?= develop SPHINXOPTS ?= -n +# do poetry install only in case if poetry.lock or pyproject.toml where updated and +# we require a rebuilt. .venv/.st-venv-completed: poetry.lock pyproject.toml poetry install --verbose --with $(EXTRAS) touch .venv/.st-venv-completed @@ -10,7 +12,6 @@ SPHINXOPTS ?= -n .PHONY: dev dev: .venv/.st-venv-completed - .PHONY: precommit precommit: dev poetry run pre-commit run -a From a91278bba763ee37ce3a37ed4acbecdaeb4db659 Mon Sep 17 00:00:00 2001 From: Maksim Beliaev Date: Sat, 3 Sep 2022 15:40:47 +0200 Subject: [PATCH 4/4] comment --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index ecdbc491..63c3e080 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -92,4 +92,3 @@ markers = [ [tool.mypy] files = ["pytest_httpserver", "scripts", "tests", "doc"] implicit_reexport = false -