Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(dev): update development commands #83

Merged
merged 1 commit into from
Nov 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 <miketheman@gmail.com>
  • Loading branch information
miketheman committed Nov 11, 2021
commit 4dd1dfd0607a0f470f0d59afd916caced7bfa08d
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,6 @@ target/

# poetry lock file - for libraries only
poetry.lock

# Installation tracking file
.install.stamp
11 changes: 7 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
.PHONY: all clean poetry test dist testrelease release

INSTALL_STAMP := .install.stamp
POETRY := $(shell command -v poetry 2> /dev/null)

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
Expand Down