<commit_before>SHELL=/bin/bash -eo pipefail

wheel: lint constants clean
	./setup.py bdist_wheel

constants: aegea/constants.json

aegea/constants.json:
	python -c "import aegea; aegea.initialize(); from aegea.util.constants import write; write()"

test_deps:
	pip install coverage flake8 pytest pytest-cov

lint: test_deps
	./setup.py flake8
	flake8 --filename='*' $$(grep -r -l '/usr/bin/env python' aegea scripts)

test: test_deps lint
	mkdir -p "$${CIRCLE_TEST_REPORTS:-.}/pytest"
	pytest --capture=no --cov=aegea test/test.py --junit-xml "$${CIRCLE_TEST_REPORTS:-.}/pytest/junit.xml"

init_docs:
	cd docs; sphinx-quickstart

docs:
	$(MAKE) -C docs html

install: clean
	pip install wheel
	python ./setup.py bdist_wheel
	pip install --upgrade dist/*.whl

install_venv: clean
	virtualenv --prompt aegea .venv
	source .venv/bin/activate; pip install --upgrade pip setuptools wheel
	source .venv/bin/activate; python ./setup.py bdist_wheel
	source .venv/bin/activate; pip install --upgrade dist/*.whl
	for s in $$(pwd)/.venv/bin/aegea*; do ln -sf $$s /usr/local/bin || echo "Unable to link to $$s in /usr/local/bin"; done
	-mkdir -p ~/bin
	for s in $$(pwd)/.venv/bin/aegea*; do ln -sf $$s ~/bin || echo "Unable to link to $$s in ~/bin; run \". $$(pwd)/.venv/bin/activate\" to activate the aegea installation"; done

clean:
	-rm -rf build dist
	-rm -rf *.egg-info
	-rm -rf .venv

.PHONY: wheel lint test test_deps docs install clean

include common.mk<commit_msg>Don't symlink aegea in bin to avoid pip uninstall bugs<commit_after>SHELL=/bin/bash -eo pipefail

wheel: lint constants clean
	./setup.py bdist_wheel

constants: aegea/constants.json

aegea/constants.json:
	python -c "import aegea; aegea.initialize(); from aegea.util.constants import write; write()"

test_deps:
	pip install coverage flake8 pytest pytest-cov

lint: test_deps
	./setup.py flake8
	flake8 --filename='*' $$(grep -r -l '/usr/bin/env python' aegea scripts)

test: test_deps lint
	mkdir -p "$${CIRCLE_TEST_REPORTS:-.}/pytest"
	pytest --capture=no --cov=aegea test/test.py --junit-xml "$${CIRCLE_TEST_REPORTS:-.}/pytest/junit.xml"

init_docs:
	cd docs; sphinx-quickstart

docs:
	$(MAKE) -C docs html

install: clean
	pip install wheel
	python ./setup.py bdist_wheel
	pip install --upgrade dist/*.whl

install_venv: clean
	virtualenv --prompt aegea .venv
	source .venv/bin/activate; pip install --upgrade pip setuptools wheel
	source .venv/bin/activate; python ./setup.py bdist_wheel
	source .venv/bin/activate; pip install --upgrade dist/*.whl
	@echo "Run \". $$(pwd)/.venv/bin/activate\" to activate the aegea installation"

clean:
	-rm -rf build dist
	-rm -rf *.egg-info
	-rm -rf .venv

.PHONY: wheel lint test test_deps docs install clean

include common.mk
{'fraction_non_alphanumeric': 0.1371616678858815, 'fraction_numerical': 0.0021945866861741038, 'mean_word_length': 3.7236614853195165, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '3148948', 'n_tokens_mistral': 1086, 'n_tokens_neox': 1062, 'n_words': 304}