<commit_before>default: test

testserver: env
	.env/bin/python manage.py testserver

db:
	createdb mailboxer || true

frontend: env
	gulp
.PHONY: frontend

clean:
	rm -rf .env
	find . -name "*.pyc" -delete

env: .env/.up-to-date

.PHONY: env

.env/.up-to-date: base_requirements.txt flask_app/pip_requirements.txt Makefile package.json bower.json
	@echo "\x1b[32;01mSetting up environment. This could take a while...\x1b[0m"
	virtualenv .env
	.env/bin/pip install -r base_requirements.txt
	.env/bin/pip install -r flask_app/pip_requirements.txt
	.env/bin/pip install pytest flask-loopback requests mailboxer-python
	npm install
	npm install -g gulp
	bower install
	touch .env/.up-to-date

deploy: src_pkg.tar env
	.env/bin/ansible-playbook -i ansible/inventories/production ansible/site.yml

deploy_staging: src_pkg.tar env
	.env/bin/ansible-playbook -i ansible/inventories/staging ansible/site.yml


deploy_localhost: src_pkg.tar env
	.env/bin/ansible-playbook -i ansible/inventories/localhost -c local --sudo ansible/site.yml

deploy_localhost_travis: deploy_localhost
	sleep 20 # travis uses slow nodes and tends to take time to bring the uwsgi app online

deploy_vagrant: env src_pkg.tar vagrant_up
	ANSIBLE_HOST_KEY_CHECKING=False .env/bin/ansible-playbook -i ansible/inventories/vagrant ansible/site.yml

vagrant_up:
	vagrant up
.PHONY: vagrant_up

src_pkg.tar:
	python scripts/build_tar.py
.PHONY: src_pkg.tar

test: env
	.env/bin/py.test tests/test_ut

travis_test: travis_system_install deploy_localhost_travis
	.env/bin/py.test tests/ --www-port=80 

travis_system_install:
	sudo apt-get update
	sudo apt-get install -y build-essential python-dev libevent-dev python-virtualenv

db_revision: env
	.env/bin/python manage.py db revision --autogenerate

db_migrate: env
	.env/bin/python manage.py db upgrade

activity: env
	.env/bin/python scripts/activity.py<commit_msg>Fix travis test<commit_after>default: test

testserver: env
	.env/bin/python manage.py testserver

db:
	createdb mailboxer || true

frontend: env
	gulp
.PHONY: frontend

clean:
	rm -rf .env
	find . -name "*.pyc" -delete

env: .env/.up-to-date

.PHONY: env

.env/.up-to-date: base_requirements.txt flask_app/pip_requirements.txt Makefile package.json bower.json
	@echo "\x1b[32;01mSetting up environment. This could take a while...\x1b[0m"
	virtualenv .env
	.env/bin/pip install -r base_requirements.txt
	.env/bin/pip install -r flask_app/pip_requirements.txt
	.env/bin/pip install pytest flask-loopback requests mailboxer-python
	npm install
	npm install -g gulp
	bower install
	touch .env/.up-to-date

deploy: src_pkg.tar env
	.env/bin/ansible-playbook -i ansible/inventories/production ansible/site.yml

deploy_staging: src_pkg.tar env
	.env/bin/ansible-playbook -i ansible/inventories/staging ansible/site.yml


deploy_localhost: src_pkg.tar env
	.env/bin/ansible-playbook -i ansible/inventories/localhost -c local --sudo ansible/site.yml

deploy_localhost_travis: deploy_localhost
	sleep 20 # travis uses slow nodes and tends to take time to bring the uwsgi app online

deploy_vagrant: env src_pkg.tar vagrant_up
	ANSIBLE_HOST_KEY_CHECKING=False .env/bin/ansible-playbook -i ansible/inventories/vagrant ansible/site.yml

vagrant_up:
	vagrant up
.PHONY: vagrant_up

src_pkg.tar:
	python scripts/build_tar.py
.PHONY: src_pkg.tar

test: env
	.env/bin/py.test tests/test_ut

travis_test: travis_system_install deploy_localhost_travis
	.env/bin/py.test tests/ --www-port=80 --smtp-port=25

travis_system_install:
	sudo apt-get update
	sudo apt-get install -y build-essential python-dev libevent-dev python-virtualenv

db_revision: env
	.env/bin/python manage.py db revision --autogenerate

db_migrate: env
	.env/bin/python manage.py db upgrade

activity: env
	.env/bin/python scripts/activity.py
{'fraction_non_alphanumeric': 0.09703075291622482, 'fraction_numerical': 0.006362672322375398, 'mean_word_length': 4.168493150684932, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5403600', 'n_tokens_mistral': 1472, 'n_tokens_neox': 1414, 'n_words': 342}