Skip to content
This repository has been archived by the owner on Oct 8, 2024. It is now read-only.

Commit

Permalink
Merge pull request #822 from engnadeau/build/makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
engnadeau authored Aug 26, 2022
2 parents 8f5dfab + 2d8ac36 commit f92821a
Showing 1 changed file with 27 additions and 36 deletions.
63 changes: 27 additions & 36 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,72 +1,63 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# checks and linting
.DEFAULT_GOAL := build

.PHONY: check-package
check-package:
poetry check -v
.PHONY: check
check: lint

.PHONY: check-typing
check-typing:
.PHONY: lint
lint:
poetry check -v
poetry run mypy --strict --show-error-codes .

.PHONY: check-format
check-format:
poetry run black --check .
poetry run isort -c .

.PHONY: lint
lint:
poetry run flake8 pybotics tests examples
poetry run vulture --min-confidence 80 --sort-by-size pybotics tests examples

.PHONY: check
check: check-format check-package check-typing lint

.PHONY: debug
debug:
@echo "Git version: $(shell git describe --tags)"
poetry debug

# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# formatting

.PHONY: format
format:
poetry run black .
poetry run isort .

# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# testing

.PHONY: test
test:
PYTHONPATH=. poetry run pytest --cov=pybotics --cov-report term-missing --cov-config .coveragerc --verbose
PYTHONPATH=. \
poetry run pytest \
--cov=pybotics \
--cov-report term-missing \
--cov-config .coveragerc \
--verbose

.PHONY: test-notebooks
test-notebooks:
poetry run jupyter nbconvert --execute examples/*.ipynb
test-notebooks: examples/*.ipynb
for file in $^; do \
poetry run jupyter nbconvert --execute $${file}; \
done

# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# packaging
.PHONY: test-examples
test-examples: examples/*.py
for file in $^; do \
poetry run python $${file}; \
done

.PHONY: build
build:
poetry build

.PHONY: update-dev-dependencies
update-dev-dependencies:
poetry run python scripts/update_dev_dependencies.py

# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# documentation

.PHONY: paper
paper:
cd paper && pandoc paper.md -o paper.pdf --bibliography=paper.bib
cd paper && \
pandoc paper.md \
-o paper.pdf \
--bibliography=paper.bib

.PHONY: docs
docs: docs-api
poetry run sphinx-build -b html docs docs/_build
poetry run sphinx-build \
-b html docs docs/_build

.PHONY: docs-api
docs-api:
Expand Down

0 comments on commit f92821a

Please sign in to comment.