github.com/filecoin-project/bacalhau@v0.3.23-0.20230228154132-45c989550ace/python/Makefile (about)

     1  POETRY := $(shell command -v poetry 2> /dev/null)
     2  
     3  sources = bacalhau_sdk
     4  
     5  .`.PHONY: all
     6  all: format lint pre-commit test
     7  
     8  .PHONY: test
     9  test: unittest coverage
    10  
    11  .PHONY: format
    12  format:
    13  	$(POETRY) run isort $(sources) tests examples
    14  	$(POETRY) run black $(sources) tests examples
    15  
    16  .PHONY: lint
    17  lint:
    18  	$(POETRY) run flake8 $(sources) tests examples
    19  	$(POETRY) run mypy $(sources) tests examples
    20  
    21  .PHONY: unittest
    22  unittest:
    23  	$(POETRY) run pytest --capture=no --log-cli-level=DEBUG
    24  
    25  .PHONY: coverage
    26  coverage:
    27  	$(POETRY) run pytest --cov=$(sources) --cov-branch --cov-report=term-missing tests
    28  
    29  .PHONY: install-pre-commit
    30  install-pre-commit:
    31  	$(POETRY) run pre-commit install
    32  	@echo "Pre-commit installed."
    33  
    34  .PHONY: pre-commit
    35  pre-commit:
    36  	$(POETRY) run pre-commit run --files ./**/*
    37  
    38  .PHONY: clean
    39  clean:
    40  	rm -rf .mypy_cache .pytest_cache
    41  	rm -rf *.egg-info
    42  	rm -rf .tox dist site
    43  	rm -rf coverage.xml .coverage