mirror of
https://github.com/qurator-spk/eynollah.git
synced 2025-06-09 20:29:55 +02:00
improve+extend makefile
This commit is contained in:
parent
46618f4229
commit
09248d4829
2 changed files with 36 additions and 17 deletions
52
Makefile
52
Makefile
|
@ -1,10 +1,17 @@
|
|||
EYNOLLAH_MODELS ?= $(PWD)/models_eynollah
|
||||
export EYNOLLAH_MODELS
|
||||
PYTHON ?= python3
|
||||
PIP ?= pip3
|
||||
|
||||
# DOCKER_BASE_IMAGE = artefakt.dev.sbb.berlin:5000/sbb/ocrd_core:v2.68.0
|
||||
DOCKER_BASE_IMAGE = docker.io/ocrd/core:v2.68.0
|
||||
DOCKER_BASE_IMAGE = docker.io/ocrd/core-cuda-tf2:v3.3.0
|
||||
DOCKER_TAG = ocrd/eynollah
|
||||
|
||||
#MODEL := 'https://qurator-data.de/eynollah/2021-04-25/models_eynollah.tar.gz'
|
||||
#MODEL := 'https://qurator-data.de/eynollah/2022-04-05/models_eynollah_renamed.tar.gz'
|
||||
MODEL := 'https://qurator-data.de/eynollah/2022-04-05/models_eynollah.tar.gz'
|
||||
#MODEL := 'https://github.com/qurator-spk/eynollah/releases/download/v0.3.0/models_eynollah.tar.gz'
|
||||
#MODEL := 'https://github.com/qurator-spk/eynollah/releases/download/v0.3.1/models_eynollah.tar.gz'
|
||||
|
||||
PYTEST_ARGS ?=
|
||||
|
||||
# BEGIN-EVAL makefile-parser --make-help Makefile
|
||||
|
||||
|
@ -12,12 +19,19 @@ help:
|
|||
@echo ""
|
||||
@echo " Targets"
|
||||
@echo ""
|
||||
@echo " models Download and extract models to $(PWD)/models_eynollah"
|
||||
@echo " install Install with pip"
|
||||
@echo " docker Build Docker image"
|
||||
@echo " build Build Python source and binary distribution"
|
||||
@echo " install Install package with pip"
|
||||
@echo " install-dev Install editable with pip"
|
||||
@echo " deps-test Install test dependencies with pip"
|
||||
@echo " models Download and extract models to $(CURDIR)/models_eynollah"
|
||||
@echo " smoke-test Run simple CLI check"
|
||||
@echo " test Run unit tests"
|
||||
@echo ""
|
||||
@echo " Variables"
|
||||
@echo " DOCKER_TAG Docker image tag for 'docker' [$(DOCKER_TAG)]"
|
||||
@echo " PYTEST_ARGS pytest args for 'test' (Set to '-s' to see log output during test execution, '-vv' to see individual tests. [$(PYTEST_ARGS)]"
|
||||
@echo " MODEL URL of 'models' archive to download for 'test' [$(MODEL)]"
|
||||
@echo ""
|
||||
|
||||
# END-EVAL
|
||||
|
@ -27,29 +41,32 @@ help:
|
|||
models: models_eynollah
|
||||
|
||||
models_eynollah: models_eynollah.tar.gz
|
||||
tar xf models_eynollah.tar.gz
|
||||
tar zxf models_eynollah.tar.gz
|
||||
|
||||
models_eynollah.tar.gz:
|
||||
# wget 'https://qurator-data.de/eynollah/2021-04-25/models_eynollah.tar.gz'
|
||||
# wget 'https://qurator-data.de/eynollah/2022-04-05/models_eynollah_renamed.tar.gz'
|
||||
wget 'https://qurator-data.de/eynollah/2022-04-05/models_eynollah.tar.gz'
|
||||
# wget 'https://github.com/qurator-spk/eynollah/releases/download/v0.3.0/models_eynollah.tar.gz'
|
||||
# wget 'https://github.com/qurator-spk/eynollah/releases/download/v0.3.1/models_eynollah.tar.gz'
|
||||
wget $(MODEL)
|
||||
|
||||
build:
|
||||
$(PIP) install build
|
||||
$(PYTHON) -m build .
|
||||
|
||||
# Install with pip
|
||||
install:
|
||||
pip install .
|
||||
$(PIP) install .
|
||||
|
||||
# Install editable with pip
|
||||
install-dev:
|
||||
pip install -e .
|
||||
$(PIP) install -e .
|
||||
|
||||
smoke-test:
|
||||
eynollah layout -i tests/resources/kant_aufklaerung_1784_0020.tif -o . -m $(PWD)/models_eynollah
|
||||
deps-test:
|
||||
$(PIP) install -r requirements-test.txt
|
||||
|
||||
smoke-test: deps-test
|
||||
eynollah layout -i tests/resources/kant_aufklaerung_1784_0020.tif -o . -m $(CURDIR)/models_eynollah
|
||||
|
||||
# Run unit tests
|
||||
test:
|
||||
pytest tests
|
||||
test: deps-test
|
||||
EYNOLLAH_MODELS=$(CURDIR)/models_eynollah $(PYTHON) -m pytest tests --durations=0 --continue-on-collection-errors $(PYTEST_ARGS)
|
||||
|
||||
# Build docker image
|
||||
docker:
|
||||
|
@ -59,3 +76,4 @@ docker:
|
|||
--build-arg BUILD_DATE=$$(date -u +"%Y-%m-%dT%H:%M:%SZ") \
|
||||
-t $(DOCKER_TAG) .
|
||||
|
||||
.PHONY: models build install install-dev test smoke-test docker help
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue