Last active
December 24, 2024 05:44
-
-
Save rednafi/7b3b232a2c4b13875b7d6e6d7e0f8d85 to your computer and use it in GitHub Desktop.
Applying Black, Flake8, Isort and typechecking with mypy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.PHONY: help | |
help: | |
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' | |
.PHONY: venvcheck ## Check if venv is active | |
venvcheck: | |
ifeq ("$(VIRTUAL_ENV)","") | |
@echo "Venv is not activated!" | |
@echo "Activate venv first." | |
@echo | |
exit 1 | |
endif | |
install: venvcheck ## Install the dependencies | |
@poetry install | |
test: venvcheck ## Run the tests | |
@tox | |
lint: venvcheck ## Run Black and Isort linters | |
@black . | |
@isort . | |
upgrade: venvcheck ## Upgrade the dependencies | |
poetry update | |
downgrade: venvcheck ## Downgrade the dependencies | |
git checkout pyproject.toml && git checkout poetry.lock | |
example: venvcheck ## Run the examples | |
@python example.py | |
publish: venvcheck ## Build and publish to PYPI | |
@poetry build | |
@poetry publish |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment