<commit_before>env:
	python2.7 ./vendor/virtualenv-1.7.1.2.py \
				--unzip-setuptools \
				--prompt="[gittip] " \
				--never-download \
				--extra-search-dir=./vendor/ \
				--distribute \
				./env/
	./env/bin/pip install -r requirements.txt
	./env/bin/pip install ./vendor/nose-1.1.2.tar.gz
	./env/bin/pip install -e ./


clean:
	rm -rf env *.egg *.egg-info tests/env
	find . -name \*.pyc -delete

local.env:
	echo "Creating a local.env file ..."
	echo
	echo "CANONICAL_HOST=" > local.env
	echo "CANONICAL_SCHEME=http" >> local.env
	echo "DATABASE_URL=postgres://gittip@localhost/gittip" >> local.env
	echo "STRIPE_SECRET_API_KEY=1" >> local.env
	echo "STRIPE_PUBLISHABLE_API_KEY=1" >> local.env
	echo "BALANCED_API_SECRET=<KEY>" >> local.env
	echo "GITHUB_CLIENT_ID=3785a9ac30df99feeef5" >> local.env
	echo "GITHUB_CLIENT_SECRET=e69825fafa163a0b0b6d2424c107a49333d46985" >> local.env
	echo "GITHUB_CALLBACK=http://localhost:8537/github/associate" >> local.env
	echo "TWITTER_CONSUMER_KEY=<KEY>" >> local.env
	echo "TWITTER_CONSUMER_SECRET=<KEY>" >> local.env
	echo "TWITTER_CALLBACK=http://127.0.0.1:8537/on/twitter/associate" >> local.env

run: env local.env
	./env/bin/swaddle local.env ./env/bin/aspen \
		--www_root=www/ \
		--project_root=.. \
		--show_tracebacks=yes \
		--changes_reload=yes \
		--network_address=:8537

test: env tests/env data
	./env/bin/swaddle tests/env ./env/bin/nosetests ./tests/

tests/env:
	echo "Creating a tests/env file ..."
	echo
	echo "CANONICAL_HOST=" > tests/env
	echo "CANONICAL_SCHEME=http" >> tests/env
	echo "DATABASE_URL=postgres://gittip-test@localhost/gittip-test" >> tests/env
	echo "STRIPE_SECRET_API_KEY=1" >> tests/env
	echo "STRIPE_PUBLISHABLE_API_KEY=1" >> tests/env
	echo "BALANCED_API_SECRET=<KEY>" >> tests/env
	echo "GITHUB_CLIENT_ID=3785a9ac30df99feeef5" >> tests/env
	echo "GITHUB_CLIENT_SECRET=e69825fafa163a0b0b6d2424c107a49333d46985" >> tests/env
	echo "GITHUB_CALLBACK=http://localhost:8537/github/associate" >> tests/env
	echo "TWITTER_CONSUMER_KEY=QBB9vEhxO4DFiieRF68zTA" >> tests/env
	echo "TWITTER_CONSUMER_SECRET=<KEY>" >> tests/env
	echo "TWITTER_CALLBACK=http://127.0.0.1:8537/on/twitter/associate" >> tests/env
<commit_msg>Fix GitHub callback in `make local.env` (#99)<commit_after>env:
	python2.7 ./vendor/virtualenv-1.7.1.2.py \
				--unzip-setuptools \
				--prompt="[gittip] " \
				--never-download \
				--extra-search-dir=./vendor/ \
				--distribute \
				./env/
	./env/bin/pip install -r requirements.txt
	./env/bin/pip install ./vendor/nose-1.1.2.tar.gz
	./env/bin/pip install -e ./


clean:
	rm -rf env *.egg *.egg-info tests/env
	find . -name \*.pyc -delete

local.env:
	echo "Creating a local.env file ..."
	echo
	echo "CANONICAL_HOST=" > local.env
	echo "CANONICAL_SCHEME=http" >> local.env
	echo "DATABASE_URL=postgres://gittip@localhost/gittip" >> local.env
	echo "STRIPE_SECRET_API_KEY=1" >> local.env
	echo "STRIPE_PUBLISHABLE_API_KEY=1" >> local.env
	echo "BALANCED_API_SECRET=<KEY>" >> local.env
	echo "GITHUB_CLIENT_ID=3785a9ac30df99feeef5" >> local.env
	echo "GITHUB_CLIENT_SECRET=e69825fafa163a0b0b6d2424c107a49333d46985" >> local.env
	echo "GITHUB_CALLBACK=http://localhost:8537/on/github/associate" >> local.env
	echo "TWITTER_CONSUMER_KEY=<KEY>" >> local.env
	echo "TWITTER_CONSUMER_SECRET=<KEY>QFYRi79EYYVeOZGrhj27H59H78" >> local.env
	echo "TWITTER_CALLBACK=http://127.0.0.1:8537/on/twitter/associate" >> local.env

run: env local.env
	./env/bin/swaddle local.env ./env/bin/aspen \
		--www_root=www/ \
		--project_root=.. \
		--show_tracebacks=yes \
		--changes_reload=yes \
		--network_address=:8537

test: env tests/env data
	./env/bin/swaddle tests/env ./env/bin/nosetests ./tests/

tests/env:
	echo "Creating a tests/env file ..."
	echo
	echo "CANONICAL_HOST=" > tests/env
	echo "CANONICAL_SCHEME=http" >> tests/env
	echo "DATABASE_URL=postgres://gittip-test@localhost/gittip-test" >> tests/env
	echo "STRIPE_SECRET_API_KEY=1" >> tests/env
	echo "STRIPE_PUBLISHABLE_API_KEY=1" >> tests/env
	echo "BALANCED_API_SECRET=<KEY>" >> tests/env
	echo "GITHUB_CLIENT_ID=3785a9ac30df99feeef5" >> tests/env
	echo "GITHUB_CLIENT_SECRET=e69825fafa163a0b0b6d2424c107a49333d46985" >> tests/env
	echo "GITHUB_CALLBACK=http://localhost:8537/on/github/associate" >> tests/env
	echo "TWITTER_CONSUMER_KEY=<KEY>" >> tests/env
	echo "TWITTER_CONSUMER_SECRET=<KEY>OZGrhj27H59H78" >> tests/env
	echo "TWITTER_CALLBACK=http://127.0.0.1:8537/on/twitter/associate" >> tests/env

{'fraction_non_alphanumeric': 0.15691548980049316, 'fraction_numerical': 0.0587312261824703, 'mean_word_length': 4.15242494226328, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 106, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 6, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3964756', 'n_tokens_mistral': 2128, 'n_tokens_neox': 1894, 'n_words': 276}