Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check.sh fails on stock dissertation_template_latex_sample.pdf #39

Open
thehale opened this issue Feb 7, 2023 · 1 comment
Open

check.sh fails on stock dissertation_template_latex_sample.pdf #39

thehale opened this issue Feb 7, 2023 · 1 comment

Comments

@thehale
Copy link

thehale commented Feb 7, 2023

Problem Summary

After following the instructions in the README to create the sample PDF, running check.sh fails all but one test.

Expected Behavior

The sample workflow passes all tests.

Steps to Reproduce

  1. Download the code (clone or zip)
  2. Make all the scripts executable
    chmod +x build.sh
    chmod +x latexmk.sh
    chmod +x check.sh
    
  3. Build the sample PDF following the README instructions
    ./build.sh
    ./latexmk.sh -f -cd -interaction=batchmode -pdf -xelatex dissertation_template_latex_sample.tex
    
  4. Attempt to check the built PDF
    ./check.sh dissertation_template_latex_sample.pdf
    
  5. See the error messages
    ============================= test session starts ==============================
    platform linux -- Python 3.11.1, pytest-7.2.1, pluggy-1.0.0 -- /usr/local/bin/python
    cachedir: .pytest_cache
    rootdir: /usr/src/app, configfile: pytest.ini, testpaths: pdfcheck/tests
    collecting ... collected 14 items
    
    pdfcheck/tests/basic.py::test_annotations[pdf0] PASSED
    pdfcheck/tests/font.py::test_font[pdf0] FAILED
    pdfcheck/tests/margins.py::test_paper_size[pdf0] FAILED
    pdfcheck/tests/margins.py::test_margins[pdf0] FAILED
    pdfcheck/tests/title_page.py::test_title[pdf0] ERROR
    pdfcheck/tests/title_page.py::test_by[pdf0] ERROR
    pdfcheck/tests/title_page.py::test_author[pdf0] ERROR
    pdfcheck/tests/title_page.py::test_description[pdf0] ERROR
    pdfcheck/tests/title_page.py::test_approval_by[pdf0] ERROR
    pdfcheck/tests/title_page.py::test_committee[pdf0] ERROR
    pdfcheck/tests/title_page.py::test_university[pdf0] ERROR
    pdfcheck/tests/title_page.py::test_date[pdf0] ERROR
    pdfcheck/tests/title_page.py::test_horizontal_alignment[pdf0] ERROR
    pdfcheck/tests/title_page.py::test_vertical_alignment[pdf0] ERROR
    
    ==================================== ERRORS ====================================
    ______________________ ERROR at setup of test_title[pdf0] ______________________
    E   AttributeError: 'Document' object has no attribute 'loadPage'
    _______________________ ERROR at setup of test_by[pdf0] ________________________
    E   AttributeError: 'Document' object has no attribute 'loadPage'
    _____________________ ERROR at setup of test_author[pdf0] ______________________
    E   AttributeError: 'Document' object has no attribute 'loadPage'
    ___________________ ERROR at setup of test_description[pdf0] ___________________
    E   AttributeError: 'Document' object has no attribute 'loadPage'
    ___________________ ERROR at setup of test_approval_by[pdf0] ___________________
    E   AttributeError: 'Document' object has no attribute 'loadPage'
    ____________________ ERROR at setup of test_committee[pdf0] ____________________
    E   AttributeError: 'Document' object has no attribute 'loadPage'
    ___________________ ERROR at setup of test_university[pdf0] ____________________
    E   AttributeError: 'Document' object has no attribute 'loadPage'
    ______________________ ERROR at setup of test_date[pdf0] _______________________
    E   AttributeError: 'Document' object has no attribute 'loadPage'
    ______________ ERROR at setup of test_horizontal_alignment[pdf0] _______________
    E   AttributeError: 'Document' object has no attribute 'loadPage'
    _______________ ERROR at setup of test_vertical_alignment[pdf0] ________________
    E   AttributeError: 'Document' object has no attribute 'loadPage'
    =================================== FAILURES ===================================
    /usr/src/app/pdfcheck/core.py:197: AttributeError: 'Page' object has no attribute 'getTextPage'
    /usr/src/app/pdfcheck/tests/margins.py:71: AttributeError: 'Page' object has no attribute 'CropBox'
    /usr/src/app/pdfcheck/core.py:174: AttributeError: 'Page' object has no attribute 'CropBox'
    ==================== 3 failed, 1 passed, 10 errors in 0.13s ====================
    

Other Comments

As a Python developer, it looks like the error messages indicate a version mismatch for some dependencies (i.e. the code expects a library of version X.X.X but version Y.Y.Y is installed). I have not taken a closer look at the Docker containers or the Python code used to power these checks to verify this hunch.

@awreed
Copy link

awreed commented Feb 7, 2023

ditto

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants