structuredAttrs is enabled Sourcing python-remove-tests-dir-hook Sourcing python-catch-conflicts-hook.sh Sourcing python-remove-bin-bytecode-hook.sh Sourcing pypa-build-hook Using pypaBuildPhase Sourcing python-runtime-deps-check-hook Using pythonRuntimeDepsCheckHook Sourcing pypa-install-hook Using pypaInstallPhase Sourcing python-imports-check-hook.sh Using pythonImportsCheckPhase Sourcing python-metadata-check-hook.sh Using pythonMetadataCheckPhase Sourcing python-namespaces-hook Sourcing python-catch-conflicts-hook.sh Sourcing pytest-check-hook Using pytestCheckPhase Running phase: unpackPhase unpacking source archive /nix/store/77cd6pwijmyyyr1lcsab4l3nn8r29qp5-source source root is source setting SOURCE_DATE_EPOCH to timestamp 315619200 of file "source/uv.lock" Running phase: patchPhase applying patch /nix/store/v9wpaard62y44rmnbikarsv2xrid57kh-paths.patch patching file src/ocrmypdf/_exec/ghostscript.py Hunk #1 succeeded at 36 with fuzz 2. patching file src/ocrmypdf/_exec/jbig2enc.py patching file src/ocrmypdf/_exec/pngquant.py patching file src/ocrmypdf/_exec/tesseract.py patching file src/ocrmypdf/_exec/unpaper.py Running phase: updateAutotoolsGnuConfigScriptsPhase Running phase: configurePhase no configure script, doing nothing Running phase: buildPhase Executing pypaBuildPhase Setting SETUPTOOLS_SCM_PRETEND_VERSION to 17.13.0 Including all tracked files automatically Creating a wheel... pypa build flags: --no-isolation --outdir dist/ --wheel * Getting build dependencies for wheel... * Building wheel... Successfully built ocrmypdf-17.13.0-py3-none-any.whl Finished creating a wheel... Finished executing pypaBuildPhase buildPhase completed in 32 seconds Running phase: pythonRuntimeDepsCheckHook Executing pythonRuntimeDepsCheck Checking runtime dependencies for ocrmypdf-17.13.0-py3-none-any.whl Finished executing pythonRuntimeDepsCheck Running phase: installPhase Executing pypaInstallPhase Successfully installed ocrmypdf-17.13.0-py3-none-any.whl Finished executing pypaInstallPhase Running phase: pythonOutputDistPhase Executing pythonOutputDistPhase Finished executing pythonOutputDistPhase Running phase: fixupPhase shrinking RPATHs of ELF executables and libraries in /nix/store/rznqhrxlkcmhikk0s03b0s6mq4jbrw49-python3.14-ocrmypdf-17.13.0-dist checking for references to /build/ in /nix/store/rznqhrxlkcmhikk0s03b0s6mq4jbrw49-python3.14-ocrmypdf-17.13.0-dist... patching script interpreter paths in /nix/store/rznqhrxlkcmhikk0s03b0s6mq4jbrw49-python3.14-ocrmypdf-17.13.0-dist shrinking RPATHs of ELF executables and libraries in /nix/store/ianxgvj64ykv3j3sqqv44238ixbgnhs5-python3.14-ocrmypdf-17.13.0 checking for references to /build/ in /nix/store/ianxgvj64ykv3j3sqqv44238ixbgnhs5-python3.14-ocrmypdf-17.13.0... patching script interpreter paths in /nix/store/ianxgvj64ykv3j3sqqv44238ixbgnhs5-python3.14-ocrmypdf-17.13.0 /nix/store/ianxgvj64ykv3j3sqqv44238ixbgnhs5-python3.14-ocrmypdf-17.13.0/lib/python3.14/site-packages/ocrmypdf/__main__.py: interpreter directive changed from "#!/usr/bin/env python3" to "/nix/store/xahxrjs30p3mw0a42bqg9ikgkikskw8m-python3-3.14.8/bin/python3" stripping (with command strip and flags -S -p) in /nix/store/ianxgvj64ykv3j3sqqv44238ixbgnhs5-python3.14-ocrmypdf-17.13.0/lib /nix/store/ianxgvj64ykv3j3sqqv44238ixbgnhs5-python3.14-ocrmypdf-17.13.0/bin Rewriting #!/nix/store/xahxrjs30p3mw0a42bqg9ikgkikskw8m-python3-3.14.8/bin/python3.14 to #!/nix/store/xahxrjs30p3mw0a42bqg9ikgkikskw8m-python3-3.14.8 wrapping `/nix/store/ianxgvj64ykv3j3sqqv44238ixbgnhs5-python3.14-ocrmypdf-17.13.0/bin/ocrmypdf'... Executing pythonRemoveTestsDir Finished executing pythonRemoveTestsDir Running phase: installCheckPhase no Makefile or custom installCheckPhase, doing nothing Running phase: pythonCatchConflictsPhase Running phase: pythonRemoveBinBytecodePhase Running phase: pythonImportsCheckPhase Executing pythonImportsCheckPhase Check whether the following modules can be imported: ocrmypdf Running phase: pythonMetadataCheckPhase Executing pythonMetadataCheckPhase Running phase: pytestCheckPhase Executing pytestCheckPhase pytest flags: -m pytest -k not\ \(test_unzoned_creation_date_assumes_local_zone\)\ and\ not\ \(test_assume_local_time_zone\) --numprocesses=12 ============================= test session starts ============================== platform linux -- Python 3.14.8, pytest-9.1.1, pluggy-1.6.0 rootdir: /build/source configfile: pyproject.toml testpaths: tests plugins: hypothesis-6.168.1, xdist-3.8.0 12 workers [2194 items] ........................................................................ [ 3%] ........................................................................ [ 6%] .............s.............s............................................ [ 9%] .............ss.ss.......ss............................................. [ 13%] .x..........s.sss..s..ss.s.................................x............ [ 16%] ........................................................................ [ 19%] ........................................................................ [ 22%] ...........s.......................................................sssss [ 26%] sssssssss..s.s...sss.................................................... [ 29%] ....................................................x................... [ 32%] ........................................................................ [ 36%] ...................................................s..s.sss..s..ss..s..s [ 39%] s.ss.s.ss..ss.sss...ssssss.sss.s.ss.ss..ss.s.s.ssssss.sssssss.ss.sssssss [ 42%] .ssssss.ssssssss.ssssss..sssssssss.ss...........................ssss.... [ 45%] ..........ss............................................................ [ 49%] ....................................s.ss.s.s.ss.sss.ss.ss.ss............ [ 52%] ........................................................................ [ 55%] ........................................................................ [ 59%] ...........................s..ss...ssss.s.ss.s.s........................ [ 62%] .......................................................................s [ 65%] sss.sssss..................s............................................ [ 68%] ...........................ss........................................... [ 72%] ........ss..............ssssssssssssssssss.........................F.... [ 75%] ................................s....................................... [ 78%] ........................................................................ [ 82%] .....................................x.................................. [ 85%] ......s....................sss..............ss..ss..s................... [ 88%] ........................................................................ [ 91%] ..........ss.................s.......................................... [ 95%] ...............sssss.....................ssssssssssssssssssssss......... [ 98%] .................................. [100%] =================================== FAILURES =================================== _________________________ test_validation_performance __________________________ [gw4] linux -- Python 3.14.8 /nix/store/xahxrjs30p3mw0a42bqg9ikgkikskw8m-python3-3.14.8/bin/python3.14 one_page_ocr = PosixPath('/build/pytest-of-nixbld/pytest-0/popen-gw4/perf0/graph.pdf') tmp_path = PosixPath('/build/pytest-of-nixbld/pytest-0/popen-gw4/test_validation_performance0') def test_validation_performance(one_page_ocr, tmp_path): """A 300-page candidate validates in a few seconds. This measures scaling with the number of objects. The cost of content streams grows with the number of text-showing operators: pages of dense OCR text take about 13 ms each. """ merged = tmp_path / 'merged.pdf' sources = [pikepdf.open(one_page_ocr) for _ in range(300)] try: with pikepdf.new() as pdf: for source in sources: # Pages from separate Pdf objects are copied with all their # resources, so every page has its own fonts and images. pdf.pages.extend(source.pages) pdf.save(merged) finally: for source in sources: source.close() candidate = tmp_path / 'c.pdf' speculative_pdfa_conversion(merged, candidate, 'pdfa-2') with pikepdf.open(candidate) as pdf: assert len(pdf.pages) == 300 assert len(pdf.objects) > 300 * 5 start = time.perf_counter() report = validate_written(candidate, '2b') elapsed = time.perf_counter() - start assert report.verdict == 'pass', report.summary() # Locally this takes ~3 s; a pathological regression (e.g. quadratic # scaling in the number of objects/pages) would be many times slower, # not just somewhat slower. 20 s gives generous headroom for slow, # shared CI runners (observed 6.7 s on ubuntu-22.04/py3.13) while still # catching that kind of regression. > assert elapsed < 20.0, f"validation took {elapsed:.1f} s" E AssertionError: validation took 73.7 s E assert 73.70914469400304 < 20.0 tests/test_pdfa_internal.py:162: AssertionError ---------------------------- Captured stderr setup ----------------------------- Scanning contents ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 1/1 0:00:00 OCR ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 1/1 0:00:00 Linearizing ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 100/100 0:00:00 Recompressing JPEGs ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0% 0/0 -:--:-- Deflating JPEGs ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0% 0/0 -:--:-- JBIG2 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0% 0/0 -:--:-- =========================== short test summary info ============================ FAILED tests/test_pdfa_internal.py::test_validation_performance - AssertionError: validation took 73.7 s assert 73.70914469400304 < 20.0 ===== 1 failed, 1955 passed, 235 skipped, 4 xfailed in 1761.95s (0:29:21) ======