Skip to content

Commit

Permalink
Move to Makefile, try with "make install" or "make test"
Browse files Browse the repository at this point in the history
  • Loading branch information
tschm committed Dec 1, 2024
1 parent 934c5e7 commit cdfd8ce
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
44 changes: 44 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
.DEFAULT_GOAL := help

SHELL=/bin/bash

UNAME=$(shell uname -s)

.PHONY: install
install: ## Install a virtual environment
@poetry config virtualenvs.in-project true
@poetry install -vv


.PHONY: fmt
fmt: ## Run autoformatting and linting
@poetry run pre-commit run --all-files


.PHONY: test
test: install ## Run tests
@poetry run pytest


.PHONY: clean
clean: ## Clean up caches and build artifacts
@git clean -X -d -f


.PHONY: coverage
coverage: install ## test and coverage
@poetry run coverage run --source=funnel/. -m pytest
@poetry run coverage report -m
@poetry run coverage html

@if [ ${UNAME} == "Darwin" ]; then \
open htmlcov/index.html; \
elif [ ${UNAME} == "linux" ]; then \
xdg-open htmlcov/index.html 2> /dev/null; \
fi


.PHONY: help
help: ## Display this help screen
@echo -e "\033[1mAvailable commands:\033[0m"
@grep -E '^[a-z.A-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-18s\033[0m %s\n", $$1, $$2}' | sort
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ authors = ["Petr Vanek"]
readme = "README.md"
repository = "https://github.com/VanekPetr/investment-funnel"
homepage = "https://investment-funnel.algostrata.com"
packages = [{include = "funnel"}]

[tool.poetry.dependencies]
python = ">=3.10,<3.13"
Expand Down

0 comments on commit cdfd8ce

Please sign in to comment.