From 346ea6c0de74dfafd73f077b88bbaad85741f3f9 Mon Sep 17 00:00:00 2001 From: cn Date: Thu, 6 Aug 2020 22:01:50 +0200 Subject: [PATCH] module: add Makefile for development commands --- .travis.yml | 4 ++-- Makefile | 24 ++++++++++++++++++++++++ README.md | 4 ++++ 3 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 Makefile diff --git a/.travis.yml b/.travis.yml index 29a51e1..feaf9ec 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,5 +13,5 @@ install: - poetry install script: -- poetry run pylint bme280 -- poetry run pytest +- make lint +- make test diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..e659f61 --- /dev/null +++ b/Makefile @@ -0,0 +1,24 @@ + +# https://tech.davis-hansson.com/p/make/ +SHELL := bash +.ONESHELL: +.SHELLFLAGS := -eu -o pipefail -c +.DELETE_ON_ERROR: +.DEFAULT_GOAL := all +MAKEFLAGS += --warn-undefined-variables +MAKEFLAGS += --no-builtin-rules + +.PHONY: all +all: lint test ## Run lint and test (default goal) + +.PHONY: lint +lint: ## Lint all source code + poetry run pylint bme280 + +.PHONY: test +test: ## Run all tests + poetry run pytest + +.PHONY: help +help: ## Print this help text + @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-15s\033[0m %s\n", $$1, $$2}' diff --git a/README.md b/README.md index 990ecbd..c9c93b8 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,10 @@ Consult the data sheet and see [demo.py](demo.py) for clues how to use this libr Not all functions of the chip are supported since I focused on the *forced mode* but data readout and parameter setting should work in *normal mode*, too. Please send pull requests for improvements and bug fixes! +## Develop + +Run `make help` to find out about the available development commands. + ## License Python files in this repository are released under the [MIT license](LICENSE) except those parts from other sources which are indicated where appropriate in the files.