<commit_before>cwd = $(shell pwd)

repo-name ?= singpath/verifier-python3
tag ?= latest
version ?= $(shell cat ../../VERSION)

docker ?= docker

.images/${repo-name}.${tag}: .images/${repo-name}.${version}
	mkdir -p .images/singpath
	${docker} rmi ${repo-name}:${tag} > /dev/null 2>&1 || echo "latest tag not set yet."
	${docker} tag -f ${repo-name}:${version} ${repo-name}:${tag}
	touch $@

.images/${repo-name}.${version}: Dockerfile server.py codeverifier/**/*
	mkdir -p .images/singpath
	${docker} build --rm=true -t ${repo-name}:${version} .
	touch $@

images: .images/${repo-name}.${tag}

push-images: images
	${docker} push ${repo-name}:${version}

.PHONY: images push-images

run-image:
	${docker} run -ti --rm -p 5000:5000 -v ${cwd}:/app ${repo-name}:${version}

test:
	${docker} run -ti --rm -v ${cwd}:/app ${repo-name}:${version} python3 -m unittest discover -s codeverifier/
.PHONY: run-image test<commit_msg>Fix python verifier test runner task<commit_after>cwd = $(shell pwd)

repo-name ?= singpath/verifier-python3
tag ?= latest
version ?= $(shell cat ../../VERSION)

docker ?= docker

.images/${repo-name}.${tag}: .images/${repo-name}.${version}
	mkdir -p .images/singpath
	${docker} rmi ${repo-name}:${tag} > /dev/null 2>&1 || echo "latest tag not set yet."
	${docker} tag -f ${repo-name}:${version} ${repo-name}:${tag}
	touch $@

.images/${repo-name}.${version}: Dockerfile server.py codeverifier/**/* codeverifier/*
	mkdir -p .images/singpath
	${docker} build --rm=true -t ${repo-name}:${version} .
	touch $@

images: .images/${repo-name}.${tag}

push-images: images
	${docker} push ${repo-name}:${version}

.PHONY: images push-images

run-image:
	${docker} run -ti --rm -p 5000:5000 -v ${cwd}:/app ${repo-name}:${version}

test:
	${docker} run -ti --rm -w /app -v ${cwd}:/app ${repo-name}:${version} python3 -m unittest discover -s codeverifier/
.PHONY: run-image test
{'fraction_non_alphanumeric': 0.2245762711864407, 'fraction_numerical': 0.012711864406779662, 'mean_word_length': 4.023936170212766, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '1046090', 'n_tokens_mistral': 733, 'n_tokens_neox': 696, 'n_words': 177}