<commit_before>all: setup_py setup_coveralls setup_js setup_django

ci: setup_ci all

staging: create-staging update-staging

define resetdb_to_backup
	dropdb $1
	createdb $1
	pg_restore -O -x -n public -d $1 ~hacklab/sql-backup/last.psqlc
endef

define reset_media
	rm -rf ~/webfiles/media/
	cp -r ~timtec-production/webfiles/media ~/webfiles/
endef

define base_update
	cp timtec/settings_local_$1.py timtec/settings_local.py
	# FIXME
	~/env/bin/pip install --upgrade pip
	~/env/bin/pip install -U -r requirements/test.txt
	npm install
	~/env/bin/python manage.py migrate --noinput --fake-initial
	~/env/bin/python manage.py collectstatic --noinput
	~/env/bin/python manage.py compilemessages
	touch ~/wsgi-reload
endef

update:
	~/env/bin/pip install -U -r requirements/test.txt
	npm install
	~/env/bin/python manage.py migrate --noinput --fake-initial<commit_msg>fix build<commit_after>all: setup_py setup_coveralls setup_js setup_django

ci: setup_ci all

staging: create-staging update-staging

define resetdb_to_backup
	dropdb $1
	createdb $1
	pg_restore -O -x -n public -d $1 ~hacklab/sql-backup/last.psqlc
endef

define reset_media
	rm -rf ~/webfiles/media/
	cp -r ~timtec-production/webfiles/media ~/webfiles/
endef

define base_update
	cp timtec/settings_local_$1.py timtec/settings_local.py
	# FIXME
	~/env/bin/pip install --upgrade setuptools
	~/env/bin/pip install --upgrade distribute
	~/env/bin/pip install --upgrade pip
	~/env/bin/pip install -U -r requirements/test.txt
	npm install
	~/env/bin/python manage.py migrate --noinput --fake-initial
	~/env/bin/python manage.py collectstatic --noinput
	~/env/bin/python manage.py compilemessages
	touch ~/wsgi-reload
endef

update:
	~/env/bin/pip install -U -r requirements/test.txt
	npm install
	~/env/bin/python manage.py migrate --noinput --fake-initial
{'fraction_non_alphanumeric': 0.11331133113311331, 'fraction_numerical': 0.0044004400440044, 'mean_word_length': 3.8377659574468086, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '991908', 'n_tokens_mistral': 698, 'n_tokens_neox': 655, 'n_words': 170}