Created
August 5, 2019 11:15
-
-
Save Mdslino/d8b29e09de598c8cf40a54d3dd209bc6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Variables | |
GIT_CURRENT_BRANCH := ${shell git symbolic-ref --short HEAD} | |
BASE_DIR := ./ | |
PKG_NAME := src | |
SRC_DIR := $(BASE_DIR)/$(PKG_NAME)/ | |
PYTHONPATH := ${shell pwd} | |
init: | |
@PYTHONPATH=$(PYTHONPATH) python manage.py db init | |
migrate: | |
@PYTHONPATH=$(PYTHONPATH) python manage.py db migrate | |
upgrade: | |
@PYTHONPATH=$(PYTHONPATH) python manage.py db upgrade | |
setup: | |
@echo "---- Installing Python Dependencies ----" | |
@pip install -r requirements.txt --upgrade | |
lock: | |
@echo "Locking Requirements" | |
@pipenv lock | |
requirements: | |
@echo "Making requirements.txt" | |
@pipenv lock -r > requirements.txt | |
requirements-dev: | |
@echo "Making requirements-dev.txt" | |
@pipenv lock -r --dev > requirements-dev.txt | |
install: | |
@echo "Installing..." | |
@pipenv install | |
test: | |
@PYTHONPATH=$(PYTHONPATH) pytest --cov=src --cov-report=term-missing:skip-covered --cov-branch -vv | |
run_docker: | |
@docker-compose down -v && docker-compose up | |
# Create a new release | |
# Usage: make release v=1.0.0 | |
release: | |
@if [ "$(v)" == "" ]; then \ | |
echo "You need to specify the new release version. Ex: make release v=1.0.0"; \ | |
exit 1; \ | |
fi | |
@echo "Creating a new release version: ${v}" | |
@echo "__version__ = '${v}' # pragma: no cover" > `pwd`/$(PKG_NAME)/version.py | |
@git add $(PKG_NAME)/version.py | |
@git commit -m '${v}' | |
@git tag ${v} | |
@git push origin ${v} | |
@git push --set-upstream origin "${GIT_CURRENT_BRANCH}" | |
@git push origin | |
clean-pyc: | |
find . -name '*.pyc' -exec rm -f {} + | |
find . -name '*.pyo' -exec rm -f {} + | |
find . -name '*~' -exec rm -f {} + |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment