Skip to content

Instantly share code, notes, and snippets.

@tommorris
Last active January 27, 2023 13:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tommorris/8d5ee048b1b7209661e9ce5846b31e0e to your computer and use it in GitHub Desktop.
Save tommorris/8d5ee048b1b7209661e9ce5846b31e0e to your computer and use it in GitHub Desktop.
Makefile examples used in blogpost
pkg="a"
include "../shared/base.mk"
some_var="abcd"
check:
poetry run python check_script.py -- $(some_var)
mypy:
poetry run mypy
serve:
poetry run gunicorn -w 4 $(pkg):app
test:
poetry run pytest
.PHONY: mypy server test
pkg="a"
check:
poetry run check_script.py --my-flag -- $(some_var)
test:
poetry run python my_special_test.py
%:
@$(MAKE) -f ../shared/base.mk $@
.PHONY: check test
pkg="a"
include ../shared/vars.mk
check:
poetry run check_script.py --my-flag -- $(some_var)
test:
poetry run python my_special_test.py
%:
@$(MAKE) -f ../shared/targets.mk $@
.PHONY: check test
check:
poetry run check_script.py -- $(some_var)
mypy:
poetry run mypy
serve:
poetry run gunicorn -w 4 $(pkg):app
test:
poetry run pytest
.PHONY: check mypy server test
pkg="a"
include ../shared/base.mk
check: check-default
mypy: mypy-default
serve: serve-default
test: test-default
.PHONY: check mypy serve test
some_var="abcd"
check-default:
poetry run check_script.py -- $(some_var)
mypy-default:
poetry run mypy
serve-default:
poetry run gunicorn -w 4 $(pkg):app
test-default:
poetry run pytest
.PHONY: check-default mypy-default server-default test-default
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment