<commit_before>.PHONY        = install init html-doc install develop test jenkins createdb dropdb scratchdb clean
APP_NAME      = fixmystreet backoffice
INSTALL_PATH  = $(abspath env)
BIN_PATH      = $(INSTALL_PATH)/bin
SRC_ROOT      = django_fixmystreet

USER          = fixmystreet
GROUP         = fixmystreet
SOURCE_URL    = https://github.com/CIRB/django-fixmystreet

RPM_VERSION   = test
RPM_NAME      = fixmystreet
RPM_PREFIX    = /home/fixmystreet/django-fixmystreet
RPM_INPUTS_FILE = rpm-include-files

DBNAME        = fixmystreet
DBUSER        = fixmystreet

$(BIN_PATH):
	echo $(BIN_PATH)
	virtualenv --python=python2.7 $(INSTALL_PATH) --system-site-packages
	curl https://raw.github.com/pypa/pip/master/contrib/get-pip.py | $(BIN_PATH)/python
	curl https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py | $(BIN_PATH)/python

install: $(BIN_PATH)
	$(BIN_PATH)/python setup.py install
	$(BIN_PATH)/manage.py migrate --all
	$(BIN_PATH)/manage.py collectstatic --noinput

develop: $(BIN_PATH)
	$(BIN_PATH)/python setup.py develop
	$(BIN_PATH)/pip install --no-use-wheel -e .[debug]
	$(BIN_PATH)/manage.py migrate --all

# generate new migration script
schemamigration:
	$(BIN_PATH)/manage.py schemamigration fixmystreet --auto

html-doc:
	$(BIN_PATH)/sphinx-apidoc -fF -o doc/source/gen $(SRC_ROOT)
	$(BIN_PATH)/sphinx-build -d doc/build/doctrees doc/source doc/build/html

test: $(BIN_PATH)/manage.py
	$(BIN_PATH)/manage.py test $(APP_NAME)

lint:
	$(BIN_PATH)/flake8 --exclude migrations $(SRC_ROOT) || echo "lint errors"

jenkins: develop
	rm -rf reports
	mkdir reports
	$(BIN_PATH)/flake8 --exclude migrations $(SRC_ROOT) > reports/flake8.report || echo "lint errors"
	$(BIN_PATH)/manage.py jenkins $(APP_NAME)

createdb:
	createdb $(DBNAME) -U $(DBUSER) -T template_postgis
	$(BIN_PATH)/manage.py syncdb --migrate
	$(BIN_PATH)/manage.py loaddata bootstrap list_items applicants staging_data

dropdb:
	dropdb $(DBNAME) -U $(DBUSER)

# for scratching another db call:
# $ make DBNAME=my_fms_db_name scratchdb
scratchdb: dropdb createdb
	cp -Rf media/photos-sample/ media/photos/
	$(BIN_PATH)/manage.py loaddata sample

messages:
	cd $(SRC_ROOT); $(BIN_PATH)/manage.py makemessages -l en
	cd $(SRC_ROOT); $(BIN_PATH)/manage.py makemessages -l en -d djangojs
	$(BIN_PATH)/tx push -s
	$(BIN_PATH)/tx pull -a
	cd $(SRC_ROOT); $(BIN_PATH)/manage.py compilemessages

clean:
	cd $(INSTALL_PATH); rm -rf bin lib lib64 include # virtualenv
	rm -rf bin libs bootstrap.py src # buildout
	rm -rf reports # Jenkins
	rm -rf build dist static

initcache:
	$(BIN_PATH)/manage.py createcachetable fms_cache
<commit_msg>Makefile : load fixtures on develop and install<commit_after>.PHONY        = install init html-doc install develop test jenkins createdb dropdb scratchdb clean
APP_NAME      = fixmystreet backoffice
INSTALL_PATH  = $(abspath env)
BIN_PATH      = $(INSTALL_PATH)/bin
SRC_ROOT      = django_fixmystreet

USER          = fixmystreet
GROUP         = fixmystreet
SOURCE_URL    = https://github.com/CIRB/django-fixmystreet

RPM_VERSION   = test
RPM_NAME      = fixmystreet
RPM_PREFIX    = /home/fixmystreet/django-fixmystreet
RPM_INPUTS_FILE = rpm-include-files

DBNAME        = fixmystreet
DBUSER        = fixmystreet

$(BIN_PATH):
	echo $(BIN_PATH)
	virtualenv --python=python2.7 $(INSTALL_PATH) --system-site-packages
	curl https://raw.github.com/pypa/pip/master/contrib/get-pip.py | $(BIN_PATH)/python
	curl https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py | $(BIN_PATH)/python

install: $(BIN_PATH)
	$(BIN_PATH)/python setup.py install
	$(BIN_PATH)/manage.py migrate --all
	$(BIN_PATH)/manage.py collectstatic --noinput
	$(MAKE) fixtures

develop: $(BIN_PATH)
	$(BIN_PATH)/python setup.py develop
	$(BIN_PATH)/pip install --no-use-wheel -e .[debug]
	$(BIN_PATH)/manage.py migrate --all
	$(MAKE) fixtures

# generate new migration script
schemamigration:
	$(BIN_PATH)/manage.py schemamigration fixmystreet --auto

html-doc:
	$(BIN_PATH)/sphinx-apidoc -fF -o doc/source/gen $(SRC_ROOT)
	$(BIN_PATH)/sphinx-build -d doc/build/doctrees doc/source doc/build/html

test: $(BIN_PATH)/manage.py
	$(BIN_PATH)/manage.py test $(APP_NAME)

lint:
	$(BIN_PATH)/flake8 --exclude migrations $(SRC_ROOT) || echo "lint errors"

jenkins: develop
	rm -rf reports
	mkdir reports
	$(BIN_PATH)/flake8 --exclude migrations $(SRC_ROOT) > reports/flake8.report || echo "lint errors"
	$(BIN_PATH)/manage.py jenkins $(APP_NAME)

createdb:
	createdb $(DBNAME) -U $(DBUSER) -T template_postgis
	$(BIN_PATH)/manage.py syncdb --migrate
	$(BIN_PATH)/manage.py loaddata bootstrap list_items applicants staging_data

dropdb:
	dropdb $(DBNAME) -U $(DBUSER)

# for scratching another db call:
# $ make DBNAME=my_fms_db_name scratchdb
scratchdb: dropdb createdb
	cp -Rf media/photos-sample/ media/photos/
	$(BIN_PATH)/manage.py loaddata sample

messages:
	cd $(SRC_ROOT); $(BIN_PATH)/manage.py makemessages -l en
	cd $(SRC_ROOT); $(BIN_PATH)/manage.py makemessages -l en -d djangojs
	$(BIN_PATH)/tx push -s
	$(BIN_PATH)/tx pull -a
	cd $(SRC_ROOT); $(BIN_PATH)/manage.py compilemessages

clean:
	cd $(INSTALL_PATH); rm -rf bin lib lib64 include # virtualenv
	rm -rf bin libs bootstrap.py src # buildout
	rm -rf reports # Jenkins
	rm -rf build dist static

initcache:
	$(BIN_PATH)/manage.py createcachetable fms_cache

fixtures:
	$(BIN_PATH)/manage.py loaddata pages.json mail_templates.json

{'fraction_non_alphanumeric': 0.12676317743132887, 'fraction_numerical': 0.0025983667409057165, 'mean_word_length': 4.206763285024155, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 6, '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': '2285501', 'n_tokens_mistral': 2025, 'n_tokens_neox': 1889, 'n_words': 459}