<commit_before>SERVICE_NAME = narrative
REPO_NAME = narrative

# Installer script
INSTALLER = ./scripts/install_narrative.sh
BACKEND_TEST_SCRIPT = scripts/narrative_backend_tests.sh
FRONTEND_TEST_DIR = test

# Docker build script
DOCKER_INSTALLER = ./scripts/build_narrative_container.sh

default: build-narrative-container

build-narrative-container:
	sh $(DOCKER_INSTALLER)

docker_image: build-narrative-container

# Per PR #1328, adding an option to skip minification
dev-image:
	SKIP_MINIFY=1 DOCKER_TAG=dev sh $(DOCKER_INSTALLER)

run-dev-image:
	ENV=$(ENV) sh scripts/local-dev-run.sh

install:
	bash $(INSTALLER)

# runs the installer to locally build the Narrative in a
# local venv.
build-travis-narrative:
	bash $(INSTALLER) && \
	grunt minify && \
	sed <src/config.json.templ >src/config.json "s/{{ .Env.CONFIG_ENV }}/dev/" && \
	sed -i 's/{{ if ne .Env.CONFIG_ENV "prod" }} true {{- else }} false {{- end }}/true/' src/config.json && \
	jupyter notebook --version

test: test-backend test-frontend
	@echo "done running backend and frontend test scripts"

# test-backend should use nose, or the like, to test our
# Python extensions to the IPython notebook.
#
# Testing the IPython notebook itself is out of the scope
# of our testing here, we just want to test our interface
# with it.
test-backend:
	@echo "running backend tests"
	sh $(BACKEND_TEST_SCRIPT)
	@echo "done"

test-frontend:
	python test/unit/run_tests.py -u -i

# test-frontend-unit should use karma and jasmine to test
# each of the Javascript components of the Narrative.
# This is achieved through the grunt test invocation
test-frontend-unit:
	@echo "running frontend unit tests"
	python test/unit/run_tests.py -u
	@echo "done"

test-integration:
	@echo "running integration tests"
	python test/unit/run_tests.py -i
	@echo "done"

build-docs:<commit_msg>use local grunt, not global global npm installs are deprecated<commit_after>SERVICE_NAME = narrative
REPO_NAME = narrative

# Installer script
INSTALLER = ./scripts/install_narrative.sh
BACKEND_TEST_SCRIPT = scripts/narrative_backend_tests.sh
FRONTEND_TEST_DIR = test

# Docker build script
DOCKER_INSTALLER = ./scripts/build_narrative_container.sh

default: build-narrative-container

build-narrative-container:
	sh $(DOCKER_INSTALLER)

docker_image: build-narrative-container

# Per PR #1328, adding an option to skip minification
dev-image:
	SKIP_MINIFY=1 DOCKER_TAG=dev sh $(DOCKER_INSTALLER)

run-dev-image:
	ENV=$(ENV) sh scripts/local-dev-run.sh

install:
	bash $(INSTALLER)

# runs the installer to locally build the Narrative in a
# local venv.
build-travis-narrative:
	bash $(INSTALLER) && \
	npx grunt minify && \
	sed <src/config.json.templ >src/config.json "s/{{ .Env.CONFIG_ENV }}/dev/" && \
	sed -i 's/{{ if ne .Env.CONFIG_ENV "prod" }} true {{- else }} false {{- end }}/true/' src/config.json && \
	jupyter notebook --version

test: test-backend test-frontend
	@echo "done running backend and frontend test scripts"n

# test-backend should use nose, or the like, to test our
# Python extensions to the IPython notebook.
#
# Testing the IPython notebook itself is out of the scope
# of our testing here, we just want to test our interface
# with it.
test-backend:
	@echo "running backend tests"
	sh $(BACKEND_TEST_SCRIPT)
	@echo "done"

test-frontend:
	python test/unit/run_tests.py -u -i

# test-frontend-unit should use karma and jasmine to test
# each of the Javascript components of the Narrative.
# This is achieved through the grunt test invocation
test-frontend-unit:
	@echo "running frontend unit tests"
	python test/unit/run_tests.py -u
	@echo "done"

test-integration:
	@echo "running integration tests"
	python test/unit/run_tests.py -i
	@echo "done"

build-docs:
{'fraction_non_alphanumeric': 0.10445757250268528, 'fraction_numerical': 0.0026852846401718583, 'mean_word_length': 4.406386066763425, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '4271369', 'n_tokens_mistral': 1304, 'n_tokens_neox': 1263, 'n_words': 397}