Skip to content

Instantly share code, notes, and snippets.

@autosquid
Created September 19, 2016 09:34
Show Gist options
  • Save autosquid/3c8b293ab93b42be176cf539b2aead79 to your computer and use it in GitHub Desktop.
Save autosquid/3c8b293ab93b42be176cf539b2aead79 to your computer and use it in GitHub Desktop.
makefile in python
.PHONY: clean-pyc clean-build
clean-pyc:
find . -name '*.pyc' -exec rm --force {} +
find . -name '*.pyo' -exec rm --force {} +
find . -name '*~' -exec rm --force {} +
clean-build:
rm --force --recursive build/
rm --force --recursive dist/
rm --force --recursive *.egg-info
isort:
sh -c "isort --skip-glob=.tox --recursive . "
lint:
flake8 --exclude=.tox
test: clean-pyc
py.test --verbose --color=yes $(TEST_PATH)
run:
python manage.py runserver
help:
@echo " clean-pyc"
@echo " Remove python artifacts."
@echo " clean-build"
@echo " Remove build artifacts."
@echo " isort"
@echo " Sort import statements."
@echo " lint"
@echo " Check style with flake8."
@echo " test"
@echo " Run py.test"
@echo ' run'
@echo ' Run the `my_project` service on your local machine.'
@echo ' docker-run'
@echo ' Build and run the `my_project` service in a Docker container.'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment