Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 85ac0db032
Fetching contributors…

Cannot retrieve contributors at this time

78 lines (56 sloc) 1.671 kb
ENVBIN=$(CURDIR)/.env/bin
PIP=$(ENVBIN)/pip
PYTHON=$(ENVBIN)/python
PYBABEL=$(ENVBIN)/pybabel
BABELDIR=$(CURDIR)/base/translations
MODULE=base
CONFIG=$(MODULE).config.develop
all: .env
# target: help - Display callable targets
help:
@egrep "^# target:" [Mm]akefile
.env: requirements.txt
virtualenv --no-site-packages .env
$(PIP) install -M -r requirements.txt
# target: shell - Open application shell
.PHONY: shell
shell: .env/ manage.py
$(PYTHON) manage.py shell -c $(CONFIG)
# target: run - Run application server
.PHONY: run
run: .env/ manage.py
$(PYTHON) manage.py runserver -c $(CONFIG)
# target: db - Init and migrate application db
.PHONY: db
db: .env/ manage.py
$(PYTHON) manage.py alembic upgrade head -c $(CONFIG)
# target: audit - Audit source code
.PHONY: audit
audit:
pylama $(MODULE) -i E501
# target: test - Run tests
.PHONY: test
test: .env/ manage.py clean
$(PYTHON) manage.py test -c $(MODULE).config.test
# target: clean - Clean repo
.PHONY: clean
clean:
rm -f *.py[co] *.orig
rm -f */*.py[co] */*.orig
# target: babel - Recompile language files
.PHONY: babel
babel: $(BABELDIR)/ru
$(PYBABEL) extract -F $(BABELDIR)/babel.ini -k _gettext -k _ngettext -k lazy_gettext -o $(BABELDIR)/babel.pot --project Flask-base $(CURDIR)
$(PYBABEL) update -i $(BABELDIR)/babel.pot -d $(BABELDIR)
$(PYBABEL) compile -d $(BABELDIR)
$(BABELDIR)/ru:
$(PYBABEL) init -i $(BABELDIR)/babel.pot -d $(BABELDIR) -l ru
.PHONY: chown
chown:
sudo chown $(USER):$(USER) -R $(CURDIR)
.PHONY: pep8
pep8:
find $(MODULE) -name "*.py" | xargs -n 1 autopep8 -i
.PHONY: celery
celery:
celery worker -A base.tweetchi.celery.celery -B --loglevel=info
Jump to Line
Something went wrong with that request. Please try again.