From 4dd1dfd0607a0f470f0d59afd916caced7bfa08d Mon Sep 17 00:00:00 2001 From: Mike Fiedler Date: Thu, 11 Nov 2021 18:23:36 -0500 Subject: [PATCH] chore(dev): update development commands The existing behavior relied on making the package "installable" and having a resulting `.egg-info` file to inform Make on whether to run the installation again. Poetry removed that behavior, so now we set our own stamp file when completing the installation. Signed-off-by: Mike Fiedler --- .gitignore | 3 +++ Makefile | 11 +++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 208559d..9c1a9c5 100644 --- a/.gitignore +++ b/.gitignore @@ -75,3 +75,6 @@ target/ # poetry lock file - for libraries only poetry.lock + +# Installation tracking file +.install.stamp diff --git a/Makefile b/Makefile index 91f3807..1ac4513 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,6 @@ .PHONY: all clean poetry test dist testrelease release +INSTALL_STAMP := .install.stamp POETRY := $(shell command -v poetry 2> /dev/null) all: test @@ -7,18 +8,20 @@ all: test clean: @find . -name \*.pyc -delete @find . -name __pycache__ -delete - @rm -fr .cache/ .coverage .pytest_cache/ *.egg-info/ dist/ htmlcov/ + @rm -fr $(INSTALL_STAMP) .cache/ .coverage .pytest_cache/ *.egg-info/ dist/ htmlcov/ -poetry.lock pytest_socket.egg-info/ : +install: $(INSTALL_STAMP) +$(INSTALL_STAMP): pyproject.toml poetry.lock ifndef POETRY $(error "poetry is not available, please install it first.") endif @poetry install + @touch $(INSTALL_STAMP) -test: pytest_socket.egg-info/ +test: $(INSTALL_STAMP) @poetry run pytest -dist: clean poetry.lock +dist: clean $(INSTALL_STAMP) @poetry build testrelease: dist