From 1b2261b51dd452b282dbf8d5214011fb3e339179 Mon Sep 17 00:00:00 2001 From: Kesara Rathnayake Date: Thu, 18 Jul 2024 16:32:22 +1200 Subject: [PATCH 1/2] feat: Pin WeasyPrint 61.2 Fixes #1131 --- .github/workflows/checks.yml | 6 +++--- README.md | 2 +- docker/base.Dockerfile | 2 +- setup.cfg | 2 +- tox.ini | 2 +- xml2rfc/run.py | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 0638050a..1cec202f 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -83,7 +83,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 pyflakes "pypdf>=4.1.0" "weasyprint>=53.0,!=57.0,!=60.0" + python -m pip install -r requirements.txt tox tox-gh-actions certifi decorator dict2xml pyflakes "pypdf>=4.1.0" "weasyprint==61.2" - name: Generate Valid Tests run: | @@ -135,7 +135,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 pyflakes "pypdf>=4.1.0" "weasyprint>=53.0,!=57.0,!=60.0" + python -m pip install -r requirements.txt tox tox-gh-actions certifi decorator dict2xml pyflakes "pypdf>=4.1.0" "weasyprint==61.2" - name: Generate Valid Tests run: | @@ -185,7 +185,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 pyflakes "pypdf>=4.1.0" "weasyprint>=53.0,!=57.0,!=60.0" +# python -m pip install -r requirements.txt tox tox-gh-actions certifi decorator dict2xml pyflakes "pypdf>=4.1.0" "weasyprint==61.2" # - name: Generate Valid Tests # run: | # make yestests || true diff --git a/README.md b/README.md index a9f1540f..7f799a57 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ In order to generate PDFs, **xml2rfc** uses the [WeasyPrint] module, which depen 2. Next, install WeasyPrint python modules using pip. ```sh -pip install 'weasyprint>=53.0,!=57.0,!=60.0' +pip install xml2rfc[pdf] ``` 3. Finally, install the required fonts: * Download latest fonts from [xml2rfc-fonts](https://github.com/ietf-tools/xml2rfc-fonts/releases/latest). diff --git a/docker/base.Dockerfile b/docker/base.Dockerfile index 66c382ee..282347b3 100644 --- a/docker/base.Dockerfile +++ b/docker/base.Dockerfile @@ -54,7 +54,7 @@ RUN pip3 install --upgrade \ # Install Python dependencies RUN pip3 install -r requirements.txt \ - "weasyprint>=53.0,!=57.0,!=60.0" \ + "weasyprint==61.2" \ decorator \ dict2xml \ "pypdf>=3.2.1" diff --git a/setup.cfg b/setup.cfg index 8c6bace3..e2fff34b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -56,7 +56,7 @@ console_scripts = xml2rfc = xml2rfc.run:main [options.extras_require] -pdf = weasyprint>=53.0,!=57.0,!=60.0 +pdf = weasyprint==61.2 [bdist_wheel] universal = 1 diff --git a/tox.ini b/tox.ini index 016901e0..50c990c7 100644 --- a/tox.ini +++ b/tox.ini @@ -34,4 +34,4 @@ deps = decorator dict2xml pypdf>=4.1.0 - weasyprint>=53.0,!=57.0,!=60.0 + weasyprint==61.2 diff --git a/xml2rfc/run.py b/xml2rfc/run.py index f0cc9360..d184fdc7 100755 --- a/xml2rfc/run.py +++ b/xml2rfc/run.py @@ -83,7 +83,7 @@ def get_pdf_help(missing_libs=""): 2. Next, install weasyprint python modules using pip. - pip install 'weasyprint>=53.0,!=57.0,!=60.0' + pip install xml2rfc[pdf] 3. Finally, install the required fonts: * Download latest fonts from xml2rfc-fonts. From 8ca73b9448a3425aafaea9271b29ced2ff0b8d25 Mon Sep 17 00:00:00 2001 From: Kesara Rathnayake Date: Thu, 18 Jul 2024 16:48:12 +1200 Subject: [PATCH 2/2] build: Restrict pydyf to < 0.11.0 pydyf==0.11.0 doesn't work with Python 3.8 --- .github/workflows/checks.yml | 6 +++--- docker/base.Dockerfile | 1 + setup.cfg | 1 + tox.ini | 1 + 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 1cec202f..9e830678 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -83,7 +83,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 pyflakes "pypdf>=4.1.0" "weasyprint==61.2" + python -m pip install -r requirements.txt tox tox-gh-actions certifi decorator dict2xml pyflakes "pypdf>=4.1.0" "weasyprint==61.2" "pydyf<0.11.0" - name: Generate Valid Tests run: | @@ -135,7 +135,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 pyflakes "pypdf>=4.1.0" "weasyprint==61.2" + python -m pip install -r requirements.txt tox tox-gh-actions certifi decorator dict2xml pyflakes "pypdf>=4.1.0" "weasyprint==61.2" "pydyf<0.11.0" - name: Generate Valid Tests run: | @@ -185,7 +185,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 pyflakes "pypdf>=4.1.0" "weasyprint==61.2" +# python -m pip install -r requirements.txt tox tox-gh-actions certifi decorator dict2xml pyflakes "pypdf>=4.1.0" "weasyprint==61.2" "pydyf<0.11.0" # - name: Generate Valid Tests # run: | # make yestests || true diff --git a/docker/base.Dockerfile b/docker/base.Dockerfile index 282347b3..7b4ae9b4 100644 --- a/docker/base.Dockerfile +++ b/docker/base.Dockerfile @@ -55,6 +55,7 @@ RUN pip3 install --upgrade \ # Install Python dependencies RUN pip3 install -r requirements.txt \ "weasyprint==61.2" \ + "pydyf<0.11.0" \ decorator \ dict2xml \ "pypdf>=3.2.1" diff --git a/setup.cfg b/setup.cfg index e2fff34b..a037033b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -57,6 +57,7 @@ console_scripts = [options.extras_require] pdf = weasyprint==61.2 + pydyf<0.11.0 [bdist_wheel] universal = 1 diff --git a/tox.ini b/tox.ini index 50c990c7..d371357a 100644 --- a/tox.ini +++ b/tox.ini @@ -35,3 +35,4 @@ deps = dict2xml pypdf>=4.1.0 weasyprint==61.2 + pydyf<0.11.0