From c9e4872b80272fdb7e5083f67ae9bbd79c83a363 Mon Sep 17 00:00:00 2001 From: Kesara Rathnayake Date: Fri, 22 Apr 2022 13:51:10 +1200 Subject: [PATCH] test: Update PyPDF2 for PDF tests --- .github/workflows/checks.yml | 6 +++--- tox.ini | 2 +- xml2rfc/walkpdf.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 1bb5ce046..08834daa7 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -90,7 +90,7 @@ jobs: echo "Installing pip + wheel..." python -m pip install --upgrade pip wheel echo "Installing requirements.txt + test dependencies..." - python -m pip install -r requirements.txt tox tox-gh-actions certifi decorator dict2xml==1.6 "pycairo<1.20" PyPDF2 "weasyprint<53" + python -m pip install -r requirements.txt tox tox-gh-actions certifi decorator dict2xml==1.6 "pycairo<1.20" "PyPDF2<1.28.0" "weasyprint<53" - name: Generate Valid Tests run: | @@ -151,7 +151,7 @@ jobs: echo "Installing pip + wheel..." python -m pip install --upgrade pip wheel echo "Installing requirements.txt + test dependencies..." - python -m pip install -r requirements.txt tox tox-gh-actions certifi decorator dict2xml==1.6 "pycairo<1.20" PyPDF2 "weasyprint<53" + python -m pip install -r requirements.txt tox tox-gh-actions certifi decorator dict2xml==1.6 "pycairo<1.20" "PyPDF2<1.28.0" "weasyprint<53" - name: Generate Valid Tests run: | @@ -198,7 +198,7 @@ jobs: # echo "Installing pip + wheel..." # python -m pip install --upgrade pip wheel # echo "Installing requirements.txt + test dependencies..." -# python -m pip install -r requirements.txt tox tox-gh-actions certifi decorator dict2xml==1.6 pycairo PyPDF2 "weasyprint<53" +# python -m pip install -r requirements.txt tox tox-gh-actions certifi decorator dict2xml==1.6 pycairo "PyPDF2<1.28.0" "weasyprint<53" # - name: Generate Valid Tests # run: | diff --git a/tox.ini b/tox.ini index d0855430e..1670ed40a 100644 --- a/tox.ini +++ b/tox.ini @@ -32,5 +32,5 @@ deps = decorator dict2xml==1.6 pycairo<1.20 - pypdf2 + pypdf2<1.28.0 weasyprint<53 diff --git a/xml2rfc/walkpdf.py b/xml2rfc/walkpdf.py index 759c35cd2..f637204e2 100644 --- a/xml2rfc/walkpdf.py +++ b/xml2rfc/walkpdf.py @@ -22,7 +22,7 @@ def walk(obj, seen): dobj[k] = d iobj += i if hasattr(obj, 'extractText'): - dobj['text'] = obj.extractText() + dobj['text'] = obj.extractText(TJ_sep='') elif isinstance(obj, pypdf2.generic.ArrayObject): dobj = [] for o in obj: @@ -110,4 +110,4 @@ def main(): print('Wrote: %s' % x.name) if __name__ == "__main__": - main() \ No newline at end of file + main()