mirror of
https://github.com/mikegerber/ocrd_calamari.git
synced 2025-06-09 19:59:53 +02:00
smoke test, circle ci
Conflicts: Makefile ocrd_calamari/__init__.py
This commit is contained in:
parent
afe6eec5a2
commit
b54ccf90f7
8 changed files with 167 additions and 18 deletions
82
Makefile
82
Makefile
|
@ -1,7 +1,11 @@
|
|||
GIT_CLONE = git clone --depth 1
|
||||
# '$(PYTHON)'
|
||||
PYTHON = python
|
||||
|
||||
# Docker tag
|
||||
DOCKER_TAG = ocrd/calamari
|
||||
# '$(PIP_INSTALL)'
|
||||
PIP_INSTALL = pip install
|
||||
|
||||
# '$(GIT_CLONE)'
|
||||
GIT_CLONE = git clone --depth 1
|
||||
|
||||
# BEGIN-EVAL makefile-parser --make-help Makefile
|
||||
|
||||
|
@ -9,31 +13,75 @@ help:
|
|||
@echo ""
|
||||
@echo " Targets"
|
||||
@echo ""
|
||||
@echo " calamari git clone calamari"
|
||||
@echo " calamari_models git clone calamari_models"
|
||||
@echo " calamari/build Install calamari"
|
||||
@echo " docker Build docker image"
|
||||
@echo " install Install ocrd_calamari"
|
||||
@echo " calamari Clone calamari repo"
|
||||
@echo " calamari_models Clone calamari_models repo"
|
||||
@echo " calamari/build pip install calamari"
|
||||
@echo " deps-test Install testing python deps via pip"
|
||||
@echo " repo/assets Clone OCR-D/assets to ./repo/assets"
|
||||
@echo " test/assets Setup test assets"
|
||||
@echo " assets-clean Remove symlinks in test/assets"
|
||||
@echo " test Run unit tests"
|
||||
@echo " coverage Run unit tests and determine test coverage"
|
||||
@echo ""
|
||||
@echo " Variables"
|
||||
@echo ""
|
||||
@echo " DOCKER_TAG Docker tag"
|
||||
@echo " PYTHON '$(PYTHON)'"
|
||||
@echo " PIP_INSTALL '$(PIP_INSTALL)'"
|
||||
@echo " GIT_CLONE '$(GIT_CLONE)'"
|
||||
|
||||
# END-EVAL
|
||||
|
||||
# git clone calamari
|
||||
# Install ocrd_calamari
|
||||
install:
|
||||
$(PIP_INSTALL) .
|
||||
|
||||
# Clone calamari repo
|
||||
calamari:
|
||||
$(GIT_CLONE) https://github.com/chwick/calamari
|
||||
|
||||
# git clone calamari_models
|
||||
# Clone calamari_models repo
|
||||
calamari_models:
|
||||
$(GIT_CLONE) https://github.com/chwick/calamari_models
|
||||
|
||||
# Install calamari
|
||||
# pip install calamari
|
||||
calamari/build: calamari calamari_models
|
||||
cd calamari &&\
|
||||
pip install -r requirements.txt ;\
|
||||
python setup.py install
|
||||
cd calamari && $(PIP_INSTALL) .
|
||||
|
||||
# Build docker image
|
||||
docker:
|
||||
docker build -t '$(DOCKER_TAG)' .
|
||||
#
|
||||
# Assets and Tests
|
||||
#
|
||||
|
||||
# Install testing python deps via pip
|
||||
deps-test:
|
||||
$(PIP) install -r requirements_test.txt
|
||||
|
||||
|
||||
# Clone OCR-D/assets to ./repo/assets
|
||||
repo/assets:
|
||||
mkdir -p $(dir $@)
|
||||
git clone https://github.com/OCR-D/assets "$@"
|
||||
|
||||
|
||||
# Setup test assets
|
||||
test/assets: repo/assets
|
||||
mkdir -p $@
|
||||
cp -r -t $@ repo/assets/data/*
|
||||
|
||||
# Remove symlinks in test/assets
|
||||
assets-clean:
|
||||
rm -rf test/assets
|
||||
|
||||
# Run unit tests
|
||||
test: test/assets calamari_models
|
||||
# declare -p HTTP_PROXY
|
||||
$(PYTHON) -m pytest --continue-on-collection-errors test $(PYTEST_ARGS)
|
||||
|
||||
# Run unit tests and determine test coverage
|
||||
coverage:
|
||||
coverage erase
|
||||
make test PYTHON="coverage run"
|
||||
coverage report
|
||||
coverage html
|
||||
|
||||
.PHONY: assets-clean test
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue