Skip to content

Commit

Permalink
Merge pull request #21 from jacebrowning/rename-all
Browse files Browse the repository at this point in the history
Rename 'ci' target to 'all'
  • Loading branch information
jacebrowning committed Mar 4, 2023
2 parents df2af1a + 8dba6b8 commit 0757693
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 36 deletions.
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Build the documentation:
$ make docs
```

## Automatic
### Automatic

Keep all of the above tasks running on change:

Expand All @@ -61,12 +61,12 @@ $ make dev

> In order to have OS X notifications, `brew install terminal-notifier`.
## Continuous Integration
### Continuous Integration

The CI server will report overall build status:

```text
$ make ci
$ make all
```

## Demo Tasks
Expand Down
65 changes: 32 additions & 33 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,12 @@ MODULES := $(wildcard $(PACKAGE)/*.py)
# MAIN TASKS ##################################################################

.PHONY: all
all: install

.PHONY: ci
ci: format check test mkdocs ## Run all tasks that determine CI status
all: format check test mkdocs ## Run all tasks that determine CI status

.PHONY: dev
dev: install .clean-test ## Continuously run all CI tasks when files chanage
dev: install .clean-test ## Continuously run CI tasks when files chanage
poetry run sniffer

.PHONY: run
run: install ## Start the program
poetry run python $(PACKAGE)/__main__.py --debug

.PHONY: shell
shell: install ## Launch an IPython session
poetry run ipython --ipython-dir=notebooks

# SYSTEM DEPENDENCIES #########################################################

.PHONY: doctor
Expand All @@ -33,7 +22,7 @@ VIRTUAL_ENV ?= .venv
DEPENDENCIES := $(VIRTUAL_ENV)/.poetry-$(shell bin/checksum pyproject.toml poetry.lock)

.PHONY: install
install: $(DEPENDENCIES) .cache
install: $(DEPENDENCIES) .cache ## Install project dependencies

$(DEPENDENCIES): poetry.lock
@ rm -rf $(VIRTUAL_ENV)/.poetry-*
Expand All @@ -50,24 +39,7 @@ endif
.cache:
@ mkdir -p .cache

# CHECKS ######################################################################

.PHONY: format
format: install
poetry run isort $(PACKAGE) tests notebooks
poetry run black $(PACKAGE) tests notebooks
@ echo

.PHONY: check
check: install format ## Run formaters, linters, and static analysis
ifdef CI
git diff --exit-code
endif
poetry run mypy $(PACKAGE) tests
poetry run pylint $(PACKAGE) tests --rcfile=.pylint.ini
poetry run pydocstyle $(PACKAGE) tests

# TESTS #######################################################################
# TEST ########################################################################

RANDOM_SEED ?= $(shell date +%s)
FAILURES := .cache/pytest/v/cache/lastfailed
Expand Down Expand Up @@ -115,6 +87,23 @@ endif
read-coverage:
bin/open htmlcov/index.html

# CHECK #######################################################################

.PHONY: format
format: install
poetry run isort $(PACKAGE) tests notebooks
poetry run black $(PACKAGE) tests notebooks
@ echo

.PHONY: check
check: install format ## Run formaters, linters, and static analysis
ifdef CI
git diff --exit-code
endif
poetry run mypy $(PACKAGE) tests
poetry run pylint $(PACKAGE) tests --rcfile=.pylint.ini
poetry run pydocstyle $(PACKAGE) tests

# DOCUMENTATION ###############################################################

MKDOCS_INDEX := site/index.html
Expand Down Expand Up @@ -147,6 +136,16 @@ docs/*.png: $(MODULES)
- mv -f classes_$(PACKAGE).png docs/classes.png
- mv -f packages_$(PACKAGE).png docs/packages.png

# DEMO ########################################################################

.PHONY: run
run: install ## Start the program
poetry run python $(PACKAGE)/__main__.py --debug

.PHONY: shell
shell: install ## Launch an IPython session
poetry run ipython --ipython-dir=notebooks

# BUILD #######################################################################

DIST_FILES := dist/*.tar.gz dist/*.whl
Expand Down Expand Up @@ -204,7 +203,7 @@ clean-all: clean
# HELP ########################################################################

.PHONY: help
help: all
help: install
@ grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

.DEFAULT_GOAL := help

0 comments on commit 0757693

Please sign in to comment.