<commit_before>.PHONY: test html counts coverage sdist clean install doc integration
default: test


test:
	trial --reporter=text test

# see also http://docs.docker.io/en/latest/use/baseimages/
dockerbase-wheezy:
	@echo 'Building a minimal "wheezy" system.'
	@echo "This may take a while...and will consume about 240MB when done."
	debootstrap wheezy dockerbase-wheezy

dockerbase-wheezy-image: dockerbase-wheezy
	@echo 'Importing dockerbase-wheezy into docker'
	tar -C dockerbase-wheezy -c . | docker import - dockerbase-wheezy
	docker run dockerbase-wheezy cat /etc/issue

txtorcon-tester: Dockerfile dockerbase-wheezy-image
	@echo "Creating a Docker.io container"
	docker build -rm -q -t txtorcon-tester ./

integration: ## txtorcon-tester
	python integration/run.py

install:
	python setup.py install

doc: docs/*.rst
	cd docs && make html
	-cp dist/txtorcon-0.9.0.tar.gz docs/_build/html

coverage:
	coverage run --source=txtorcon `which trial` test
	coverage -a -d annotated_coverage
	coverage report

# dang, this is a little annoying. maybe add a shell-script which
# looks for "coverage" or "python-coverage"??
coverage-debian:
	python-coverage run --source=txtorcon `which trial` test
	python-coverage -a -d annotated_coverage
	python-coverage report

pep8:
	find txtorcon/*.py test/*.py examples/*.py | xargs pep8 --ignore=E501

pep8count:
	find txtorcon/*.py test/*.py examples/*.py | xargs pep8 --ignore=E501 | wc -l

pyflakes:
	pyflakes txtorcon/ examples/ test/

pyflakescount:
	pyflakes txtorcon/ examples/ | wc -l

clean:
	-rm -rf _trial_temp
	-rm -rf build
	-rm -rf dist
	-rm -rf html
	-rm MANIFEST
	-rm `find . -name \*.py[co]`
	-cd docs && make clean
	-rm -rf dockerbase-wheezy
	-docker rmi txtorcon-tester
	-docker rmi dockerbase-wheezy

counts:
	ohcount -s txtorcon/*.py

dist: dist/txtorcon-0.9.0.tar.gz.asc

sdist: setup.py 
	python setup.py sdist

dist/txtorcon-0.9.0-py27-none-any.whl:
	python setup.py bdist_wheel
dist/txtorcon-0.9.0-py27-none-any.whl.asc: dist/txtorcon-0.9.0-py27-none-any.whl
	gpg --verify dist/txtorcon-0.9.0-py27-none-any.whl.asc || gpg --no-version --detach-sign --armor --local-user <EMAIL> dist/txtorcon-0.9.0-py27-none-any.whl

dist/txtorcon-0.9.0.tar.gz: sdist
dist/txtorcon-0.9.0.tar.gz.asc: dist/txtorcon-0.9.0.tar.gz
	gpg --verify dist/txtorcon-0.9.0.tar.gz.asc || gpg --no-version --detach-sign --armor --local-user <EMAIL> dist/txtorcon-0.9.0.tar.gz

release: dist/txtorcon-0.9.0.tar.gz dist/txtorcon-0.9.0-py27-none-any.whl setup.py
	twine
##	python setup.py sdist upload --sign --identity=<EMAIL>

venv:
	mkdir -p tmp
	cd tmp
	virtualenv --never-download --extra-search-dir=/usr/lib/python2.7/dist-packages/ venv
	@echo "created venv"
	@echo "see INSTALL for more information; to use:"
	@echo ". ./venv/bin/activate"
	@echo "pip install -r requirements.txt"
	@echo "pip install -r dev-requirements.txt"
	@echo "python examples/monitor.py"

html: docs/README.rst
	cd docs && make html<commit_msg>just create venv, not tmp/venv<commit_after>.PHONY: test html counts coverage sdist clean install doc integration
default: test


test:
	trial --reporter=text test

# see also http://docs.docker.io/en/latest/use/baseimages/
dockerbase-wheezy:
	@echo 'Building a minimal "wheezy" system.'
	@echo "This may take a while...and will consume about 240MB when done."
	debootstrap wheezy dockerbase-wheezy

dockerbase-wheezy-image: dockerbase-wheezy
	@echo 'Importing dockerbase-wheezy into docker'
	tar -C dockerbase-wheezy -c . | docker import - dockerbase-wheezy
	docker run dockerbase-wheezy cat /etc/issue

txtorcon-tester: Dockerfile dockerbase-wheezy-image
	@echo "Creating a Docker.io container"
	docker build -rm -q -t txtorcon-tester ./

integration: ## txtorcon-tester
	python integration/run.py

install:
	python setup.py install

doc: docs/*.rst
	cd docs && make html
	-cp dist/txtorcon-0.9.0.tar.gz docs/_build/html

coverage:
	coverage run --source=txtorcon `which trial` test
	coverage -a -d annotated_coverage
	coverage report

# dang, this is a little annoying. maybe add a shell-script which
# looks for "coverage" or "python-coverage"??
coverage-debian:
	python-coverage run --source=txtorcon `which trial` test
	python-coverage -a -d annotated_coverage
	python-coverage report

pep8:
	find txtorcon/*.py test/*.py examples/*.py | xargs pep8 --ignore=E501

pep8count:
	find txtorcon/*.py test/*.py examples/*.py | xargs pep8 --ignore=E501 | wc -l

pyflakes:
	pyflakes txtorcon/ examples/ test/

pyflakescount:
	pyflakes txtorcon/ examples/ | wc -l

clean:
	-rm -rf _trial_temp
	-rm -rf build
	-rm -rf dist
	-rm -rf html
	-rm MANIFEST
	-rm `find . -name \*.py[co]`
	-cd docs && make clean
	-rm -rf dockerbase-wheezy
	-docker rmi txtorcon-tester
	-docker rmi dockerbase-wheezy

counts:
	ohcount -s txtorcon/*.py

dist: dist/txtorcon-0.9.0.tar.gz.asc

sdist: setup.py 
	python setup.py sdist

dist/txtorcon-0.9.0-py27-none-any.whl:
	python setup.py bdist_wheel
dist/txtorcon-0.9.0-py27-none-any.whl.asc: dist/txtorcon-0.9.0-py27-none-any.whl
	gpg --verify dist/txtorcon-0.9.0-py27-none-any.whl.asc || gpg --no-version --detach-sign --armor --local-user <EMAIL> dist/txtorcon-0.9.0-py27-none-any.whl

dist/txtorcon-0.9.0.tar.gz: sdist
dist/txtorcon-0.9.0.tar.gz.asc: dist/txtorcon-0.9.0.tar.gz
	gpg --verify dist/txtorcon-0.9.0.tar.gz.asc || gpg --no-version --detach-sign --armor --local-user <EMAIL> dist/txtorcon-0.9.0.tar.gz

release: dist/txtorcon-0.9.0.tar.gz dist/txtorcon-0.9.0-py27-none-any.whl setup.py
	twine
##	python setup.py sdist upload --sign --identity=<EMAIL>

venv:
	virtualenv --never-download --extra-search-dir=/usr/lib/python2.7/dist-packages/ venv
	@echo "created venv"
	@echo "see INSTALL for more information; to use:"
	@echo ". ./venv/bin/activate"
	@echo "pip install -r requirements.txt"
	@echo "pip install -r dev-requirements.txt"
	@echo "python examples/monitor.py"

html: docs/README.rst
	cd docs && make html
{'fraction_non_alphanumeric': 0.1362789910275944, 'fraction_numerical': 0.023362112747587607, 'mean_word_length': 3.4893617021276597, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, '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': '6447656', 'n_tokens_mistral': 2457, 'n_tokens_neox': 2341, 'n_words': 574}