<commit_before>cpu_count=$(shell python -c 'import multiprocessing as m; print m.cpu_count()')

nose_env=NOSE_PROCESSES=$(cpu_count) NOSE_PROCESS_TIMEOUT=1800

cmake_args=
cmake_env=
ifdef VIRTUAL_ENV
	cmake_args+=-DCMAKE_INSTALL_PREFIX=$(VIRTUAL_ENV)
	cmake_env+=CMAKE_PATH_PREFIX=$(VIRTUAL_ENV)
endif
cmake = $(cmake_env) cmake $(cmake_args)

all: test

debug: FORCE
	mkdir -p build/debug
	cd build/debug && $(cmake) -DCMAKE_BUILD_TYPE=Debug ../..  && $(MAKE)

release: FORCE
	mkdir -p build/release
	cd build/release && $(cmake) -DCMAKE_BUILD_TYPE=Release ../..  && $(MAKE)

install: debug release FORCE
	cd build/release && $(MAKE) install
	pip install -e .

package: release FORCE
	cd build/release && $(MAKE) package
	mv build/release/loom.tar.gz build/

clean: FORCE
	git clean -xdf -e loom.egg-info -e data

data: install FORCE
	python -m loom.datasets init

test: install data
	@pyflakes loom/schema_pb2.py \
	  || (echo '...patching schema_pb2.py' \
	    ; sed -i '/descriptor_pb2/d' loom/schema_pb2.py)  # HACK
	pyflakes setup.py loom examples
	pep8 --repeat --ignore=E265 --exclude=*_pb2.py setup.py loom examples
	$(nose_env) nosetests -v loom examples/taxi
	@echo '----------------'
	@echo 'PASSED ALL TESTS'

FORCE:<commit_msg>Don't install in-place with make install.<commit_after>cpu_count=$(shell python -c 'import multiprocessing as m; print m.cpu_count()')

nose_env=NOSE_PROCESSES=$(cpu_count) NOSE_PROCESS_TIMEOUT=1800

cmake_args=
cmake_env=
ifdef VIRTUAL_ENV
	cmake_args+=-DCMAKE_INSTALL_PREFIX=$(VIRTUAL_ENV)
	cmake_env+=CMAKE_PATH_PREFIX=$(VIRTUAL_ENV)
endif
cmake = $(cmake_env) cmake $(cmake_args)

all: test

debug: FORCE
	mkdir -p build/debug
	cd build/debug && $(cmake) -DCMAKE_BUILD_TYPE=Debug ../..  && $(MAKE)

release: FORCE
	mkdir -p build/release
	cd build/release && $(cmake) -DCMAKE_BUILD_TYPE=Release ../..  && $(MAKE)

dev: debug release FORCE
	pip install -e .

install: release FORCE
	cd build/release && $(MAKE) install
	pip install .

package: release FORCE
	cd build/release && $(MAKE) package
	mv build/release/loom.tar.gz build/

clean: FORCE
	git clean -xdf -e loom.egg-info -e data

data: dev FORCE
	python -m loom.datasets init

test: dev data
	@pyflakes loom/schema_pb2.py \
	  || (echo '...patching schema_pb2.py' \
	    ; sed -i '/descriptor_pb2/d' loom/schema_pb2.py)  # HACK
	pyflakes setup.py loom examples
	pep8 --repeat --ignore=E265 --exclude=*_pb2.py setup.py loom examples
	$(nose_env) nosetests -v loom examples/taxi
	@echo '----------------'
	@echo 'PASSED ALL TESTS'

FORCE:
{'fraction_non_alphanumeric': 0.14375738479716424, 'fraction_numerical': 0.010240252067743205, 'mean_word_length': 3.9512670565302144, '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': '5224470', 'n_tokens_mistral': 1029, 'n_tokens_neox': 968, 'n_words': 241}