-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
31 lines (26 loc) · 1.19 KB
/
Makefile
File metadata and controls
31 lines (26 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
.PHONY: quality style test
# this target runs checks on all files
quality:
ruff check .
mypy docling_ocr_onnxtr/
# this target runs checks on all files and potentially modifies some of them
style:
ruff format .
ruff check --fix .
# Run tests for the library
# NOTE: We download docling related files from the docling repo - in this case we can verify to be always up to date
test:
# Download the testing files from the docling repo
curl -L https://raw.githubusercontent.com/docling-project/docling/main/tests/verify_utils.py -o tests/verify_utils.py
curl -L https://raw.githubusercontent.com/docling-project/docling/main/tests/test_data_gen_flag.py -o tests/test_data_gen_flag.py
# Download the testing documents directly from the docling/tests folder
rm -rf temp_repo
git clone --filter=blob:none --no-checkout https://github.com/docling-project/docling.git temp_repo
cd temp_repo && git sparse-checkout init --cone
cd temp_repo && git sparse-checkout set tests/data_scanned
cd temp_repo && git checkout main
mkdir -p tests/data_scanned
cp -r temp_repo/tests/data_scanned/* tests/data_scanned/
rm -rf temp_repo
coverage run -m pytest tests/ -rs
coverage report --fail-under=80 --show-missing