Skip to content

Commit

Permalink
Update the makefile with some commands form other projects and added …
Browse files Browse the repository at this point in the history
…`make help`
  • Loading branch information
DelboyJay committed Dec 11, 2024
1 parent 5cd4d8b commit 0fd35be
Showing 1 changed file with 40 additions and 2 deletions.
42 changes: 40 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,50 @@
.PHONY: help
help:
@echo "Please use 'make <target>' where <target> is one of"
@echo " deps to install dependencies for local development"
@echo " clean to clean up environment"
@echo " lint runs linting on all the files using Ruff"
@echo " tests to run tests"
@echo " coverage to run code coverage"
@echo " install-poetry installs the correct version poetry"
@echo " uninstall-poetry uninstalls poetry if things go wrong."
@echo " tree Produces and ASCII directory tree to provide AI bots with context of the project."
@echo " showoutdatedpackages Ask poetry for a list of top-level packages that can be updated."

.PHONY: deps
deps:
poetry env remove 3.9
poetry env use 3.9
poetry install

.PHONY: lint
lint:
poetry run pre-commit run --all-files

.PHONY: clean
clean:
rm -rf .tox/ .pytest_cache/ dist/ htmlcov/ .coverage coverage.xml db.sqlite3
find . -type f -name "*.pyc" -delete

.PHONY: tests
tests: deps
tests: coverage
# ensure that `docker compose up` is running to start the redis server before
# running these tests.
poetry run tox $(pytest_args)
#poetry run pytest --no-migrations

.PHONY: coverage
coverage: lint
poetry run py.test --cov=idempotency_key tests/ --cov-report html
@echo Access the report here:
@echo file://${PWD}/htmlcov/index.html

.PHONY: install-poetry
install-poetry:
curl -sSL https://install.python-poetry.org | python3 -

.PHONY: uninstall-poetry
uninstall-poetry:
curl -sSL https://install.python-poetry.org | python3 - --uninstall

.PHONY: tree
tree:
Expand Down

0 comments on commit 0fd35be

Please sign in to comment.