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

feat: Update weasyprint to 55.0 #802

Merged
merged 3 commits into from Jul 21, 2022

Conversation

kesara
Copy link
Member

@kesara kesara commented Jun 28, 2022

  • Update weasyprint to 55.0.
  • Replace PyPDF2 with pdfplumber.

This changes PDF generation from cairo to pydyf.

Fixes #696

This changes PDF generation from cairo to pydyf.
@dkg
Copy link
Contributor

dkg commented Jul 20, 2022

fwiw, this will make things harder for me to maintain and adequately test in debian, since debian doesn't have pdfplumber. I've just gotten pypdf2 fixed upstream to be able to correctly handle the types of output produced by more recent versions of weasyprint.

For simplicity and ease of maintenance and testing, my preference would be:

  • avoid the switch from pypdf2 to pdfplumber for testing, just require pypdf2 version 2.6.0 and above (first version with the fix to avoid the CMap crashing)
  • drop all explicit mentions of cairo
  • require the first version of weasyprint that dropped cairo (53.0b1) or any newer one

@kesara
Copy link
Member Author

kesara commented Jul 20, 2022

@dkg, Thanks for the update.
pypdf2 version 2.6.0 seems to fix the issues that I had with PDF test, so I can drop that commit.
Since WeasyPrint 53.0b1 is a pre-release, I'd like to set v53.0 as the minimum Weasyprint requirement. Hope that's okay.

@@ -70,11 +71,10 @@ COPY requirements.txt .

# build xml2rfc
RUN pip3 install -r requirements.txt \
"weasyprint==52.5" \
"pycairo<1.20" \
"weasyprint>=53.0" \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be >=55 now?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why >= 55? weasyprint is actually at 56 now upstream, but there's no good reason to increase the version if you don't actually need the newer version.

Put another way: please do not gratuitously increase the minimum version needed. if 53.0 works as well, there's no reason to have the elevated version requirements.

If there is a specific reason that 55 is necessary, then of course make it required, but otherwise, you do the ecosystem a favor by indicating the flexibility explicitly.

Copy link
Member Author

@kesara kesara Jul 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any specific reason for using 55 or 56 at this point.
So I'm happy to keep weasyprint>=53.0 for wider compatibility.
But services like author tools will start using the latest available version.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, that sounds entirely reasonable. the specified version ranges are constraints, but of course any specific instance will choose whatever version of the package it wants as long as it's within the constraints.

weasyprint<53
dict2xml
pypdf2>=2.6.0
weasyprint>=53.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

another place for >=55.0?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above, i recommend keeping the minimum at 53 (where there is no cairo) unless you have a clear reason to believe that it requires 55.

xml2rfc/run.py Outdated Show resolved Hide resolved
xml2rfc/run.py Show resolved Hide resolved
@dkg
Copy link
Contributor

dkg commented Jul 20, 2022

@kesara wrote:

Since WeasyPrint 53.0b1 is a pre-release, I'd like to set v53.0 as the minimum Weasyprint requirement. Hope that's okay.

Yes, that makes sense to me. I was being hyper-precise by indicating the first visible release that dropped cairo, but you're right that it makes sense to only target "official" release versions.

@kesara kesara merged commit c6343a9 into ietf-tools:main Jul 21, 2022
@kesara kesara deleted the feat/update-weasyprint branch July 21, 2022 20:51
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Apr 1, 2023
Note: I gave up trying to make the tests run -- too many dependencies
before I ran out of time to waste on this.  But at least xml2rfc
itself seems to work.

Note: I gave up trying to update pycountry to 22.3.5 as listed in the
xml2rfc requirements.txt, because the pycountry 22.3.5 tests failed;
instead I patched xml2rfc to accept the version in pkgsrc for now.

Since xml2rfc had been rendered completely nonfunctional by updates to
its dependencies, I believe this is a better state than it was in even
if the tests can't be run.

Changes:

- [`dbdda51`](ietf-tools/xml2rfc@dbdda51) - Lighter styling on internal iref links *(PR [#963](ietf-tools/xml2rfc#963) by [@martinthomson](https://github.com/martinthomson))*
- [`ff1c061`](ietf-tools/xml2rfc@ff1c061) - Add support for Noto Math font *(PR [#971](ietf-tools/xml2rfc#971) by [@kesara](https://github.com/kesara))*

- [`636dd08`](ietf-tools/xml2rfc@636dd08) - update CHANGELOG.md + py file versions for v3.16.0 [skip ci] *(commit by [@kesara](https://github.com/kesara))*

- [`7cae8ad`](ietf-tools/xml2rfc@7cae8ad) - Remove mt.css and mt.js *(PR [#976](ietf-tools/xml2rfc#976) by [@martinthomson](https://github.com/martinthomson))*

- [`ad2e035`](ietf-tools/xml2rfc@ad2e035) - Permit non-ASCII within <t> without the use of <u> *(PR [#895](ietf-tools/xml2rfc#895) by [@cabo](https://github.com/cabo))*
- [`6b9aede`](ietf-tools/xml2rfc@6b9aede) - Add editorial stream *(PR [#958](ietf-tools/xml2rfc#958) by [@kesara](https://github.com/kesara))*
  - ↘️ *addresses issue [#896](undefined) opened by [@alicerusso](https://github.com/alicerusso)*

- [`5b687b1`](ietf-tools/xml2rfc@5b687b1) - Add 'auto' class for (most) parenthesized xref links *(PR [#948](ietf-tools/xml2rfc#948) by [@martinthomson](https://github.com/martinthomson))*
- [`388d4b9`](ietf-tools/xml2rfc@388d4b9) - Update to pypdf>=3.2.1 on base docker file *(PR [#954](ietf-tools/xml2rfc#954) by [@kesara](https://github.com/kesara))*

- [`6c9be77`](ietf-tools/xml2rfc@6c9be77) - Expand a problematic reference *(PR [#959](ietf-tools/xml2rfc#959) by [@kesara](https://github.com/kesara))*

- [`b811bfd`](ietf-tools/xml2rfc@b811bfd) - update CHANGELOG.md + py file versions for v3.15.3 [skip ci] *(commit by [@kesara](https://github.com/kesara))*

- [`5bbf3f7`](ietf-tools/xml2rfc@5bbf3f7) - **deps**: Move from PyPDF2 to pypdf>=3.2.1 *(PR [#953](ietf-tools/xml2rfc#953) by [@kesara](https://github.com/kesara))*

- [`1381bb8`](ietf-tools/xml2rfc@1381bb8) - Move sourcecode classes *(PR [#839](ietf-tools/xml2rfc#839) by [@martinthomson](https://github.com/martinthomson))*
- [`592ab81`](ietf-tools/xml2rfc@592ab81) - Only overwrite font-family when producing PDFs *(PR [#937](ietf-tools/xml2rfc#937) by [@martinthomson](https://github.com/martinthomson))*
- [`a3adb84`](ietf-tools/xml2rfc@a3adb84) - Fix margin issue with dl after p inside a li  *(PR [#941](ietf-tools/xml2rfc#941) by [@kesara](https://github.com/kesara))*

- [`9308e40`](ietf-tools/xml2rfc@9308e40) - Update walkpdf to fix PyPDF deprecation warnings *(PR [#934](ietf-tools/xml2rfc#934) by [@kesara](https://github.com/kesara))*

- [`0d3958c`](ietf-tools/xml2rfc@0d3958c) - Include OpenPGP certificates for signing the project in each release *(PR [#931](ietf-tools/xml2rfc#931) by [@dkg](https://github.com/dkg))*
- [`b451ded`](ietf-tools/xml2rfc@b451ded) - Add support for Python 3.11 *(PR [#942](ietf-tools/xml2rfc#942) by [@kesara](https://github.com/kesara))*
- [`9ff2476`](ietf-tools/xml2rfc@9ff2476) - Include all changes in Changelog *(PR [#944](ietf-tools/xml2rfc#944) by [@kesara](https://github.com/kesara))*

- [`d86b1f2`](ietf-tools/xml2rfc@d86b1f2) - update CHANGELOG.md + py file versions for v3.15.2 [skip ci] *(commit by [@kesara](https://github.com/kesara))*

- [`af9d83e`](ietf-tools/xml2rfc@af9d83e) - Skip Weasyprint 57.0 in tests *(PR [#932](ietf-tools/xml2rfc#932) by [@kesara](https://github.com/kesara))*

- [`908365f`](ietf-tools/xml2rfc@908365f) - Use wcwidth to determine the monospace textual length of a string *(PR [#914](ietf-tools/xml2rfc#914) by [@Flowdalic](https://github.com/Flowdalic))*
- [`0b42319`](ietf-tools/xml2rfc@0b42319) - Drop dependency on kitchen *(PR [#913](ietf-tools/xml2rfc#913) by [@Flowdalic](https://github.com/Flowdalic))*
- [`1a910d9`](ietf-tools/xml2rfc@1a910d9) - Expand table columns in text output  *(PR [#919](ietf-tools/xml2rfc#919) by [@kesara](https://github.com/kesara))*
- [`4f9e700`](ietf-tools/xml2rfc@4f9e700) - Add Noto Sans Symbols 2 font to PDF template *(PR [#926](ietf-tools/xml2rfc#926) by [@kesara](https://github.com/kesara))*

- [`18b34d8`](ietf-tools/xml2rfc@18b34d8) - Fix PDF tests *(PR [#920](ietf-tools/xml2rfc#920) by [@kesara](https://github.com/kesara))*

- [`7337517`](ietf-tools/xml2rfc@7337517) - Correct spelling mistakes *(PR [#917](ietf-tools/xml2rfc#917) by [@jsoref](https://github.com/jsoref))*

- [`08605de`](ietf-tools/xml2rfc@08605de) - Improve PDF generation debug logs *(PR [#907](ietf-tools/xml2rfc#907) by [@kesara](https://github.com/kesara))*
- [`12a960e`](ietf-tools/xml2rfc@12a960e) - Use specified font families on SVG *(PR [#910](ietf-tools/xml2rfc#910) by [@kesara](https://github.com/kesara))*
- [`70de803`](ietf-tools/xml2rfc@70de803) - Use noto fonts for non-latin unicode monospaced characters *(PR [#909](ietf-tools/xml2rfc#909) by [@kesara](https://github.com/kesara))*
- [`dd2b0fe`](ietf-tools/xml2rfc@dd2b0fe) - Add bottom margin to .artwork > pre *(PR [#912](ietf-tools/xml2rfc#912) by [@kesara](https://github.com/kesara))*
- [`58706b8`](ietf-tools/xml2rfc@58706b8) - Remove redundant code labels from CSS *(PR [#916](ietf-tools/xml2rfc#916) by [@kesara](https://github.com/kesara))*

- [`055d64d`](ietf-tools/xml2rfc@055d64d) - Add xml2rfc class to HTML body element *(PR [#847](ietf-tools/xml2rfc#847) by [@martinthomson](https://github.com/martinthomson))*
- [`7fec225`](ietf-tools/xml2rfc@7fec225) - Add classes to xref *(PR [#867](ietf-tools/xml2rfc#867) by [@martinthomson](https://github.com/martinthomson))*

- [`cc6b083`](ietf-tools/xml2rfc@cc6b083) - Fix table colspan issue in text format  *(PR [#886](ietf-tools/xml2rfc#886) by [@kesara](https://github.com/kesara))*
- [`2475447`](ietf-tools/xml2rfc@2475447) - Include the published date when ipr is none *(PR [#897](ietf-tools/xml2rfc#897) by [@kesara](https://github.com/kesara))*

- [`20cdb44`](ietf-tools/xml2rfc@20cdb44) - Fix odd page break inside rows in PDF output *(PR [#879](ietf-tools/xml2rfc#879) by [@kesara](https://github.com/kesara))*
- [`2c9dfaf`](ietf-tools/xml2rfc@2c9dfaf) - Return orgnization for orgnization only contacts *(PR [#837](ietf-tools/xml2rfc#837) by [@kesara](https://github.com/kesara))*
- [`9821dc6`](ietf-tools/xml2rfc@9821dc6) - RTL unicode issue in PDF *(PR [#884](ietf-tools/xml2rfc#884) by [@kesara](https://github.com/kesara))*

- [`c67f5fd`](ietf-tools/xml2rfc@c67f5fd) - Align center aligned ASCII art correctly *(PR [#838](ietf-tools/xml2rfc#838) by [@kesara](https://github.com/kesara))*

- [`701d5ce`](ietf-tools/xml2rfc@701d5ce) - Add github issue templates *(commit by [@kesara](https://github.com/kesara))*

- [`c6343a9`](ietf-tools/xml2rfc@c6343a9) - Update WeasyPrint *(PR [#802](ietf-tools/xml2rfc#802) by [@kesara](https://github.com/kesara))*

- [`95dba00`](ietf-tools/xml2rfc@95dba00) - Fix typo in README file *(PR [#843](ietf-tools/xml2rfc#843) by [@bkmgit](https://github.com/bkmgit))*
- [`0f06e27`](ietf-tools/xml2rfc@0f06e27) - Prevent submission date warnings for RFCs  *(PR [#842](ietf-tools/xml2rfc#842) by [@kesara](https://github.com/kesara))*
- [`e5c45d4`](ietf-tools/xml2rfc@e5c45d4) - Add an option to disable rfc-local.css link *(PR [#840](ietf-tools/xml2rfc#840) by [@martinthomson](https://github.com/martinthomson))*

- [`41b177a`](ietf-tools/xml2rfc@41b177a) - Fix tests to adapt bib.ietf.org *(PR [#852](ietf-tools/xml2rfc#852) by [@kesara](https://github.com/kesara))*
- [`c9b9d09`](ietf-tools/xml2rfc@c9b9d09) - Update valid tests for --no-rfc-local option *(PR [#854](ietf-tools/xml2rfc#854) by [@kesara](https://github.com/kesara))*

- [`63de72a`](ietf-tools/xml2rfc@63de72a) - Use bib.ietf.org for citations  *(PR [#804](ietf-tools/xml2rfc#804) by [@kesara](https://github.com/kesara))*
- [`ad44bb8`](ietf-tools/xml2rfc@ad44bb8) - Render unicode characters in SVG elements correctly  *(PR [#832](ietf-tools/xml2rfc#832) by [@kesara](https://github.com/kesara))*

- [`6938d80`](ietf-tools/xml2rfc@6938d80) - Drop support for Python 3.6 *(PR [#796](ietf-tools/xml2rfc#796) by [@kesara](https://github.com/kesara))*

- [`47270ba`](ietf-tools/xml2rfc@47270ba) - Handle date type errors gracefully *(PR [#795](ietf-tools/xml2rfc#795) by [@cabo](https://github.com/cabo))*
- [`79fd4d9`](ietf-tools/xml2rfc@79fd4d9) - Stop crashing when author element doesn't have a name *(PR [#800](ietf-tools/xml2rfc#800) by [@cabo](https://github.com/cabo))*
- [`d5f8a1c`](ietf-tools/xml2rfc@d5f8a1c) - Use bib.ietf.org for citations *(PR [#799](ietf-tools/xml2rfc#799) by [@kesara](https://github.com/kesara))*

- [`b94d6bb`](ietf-tools/xml2rfc@b94d6bb) - **deps**: Update Python dependencies *(PR [#797](ietf-tools/xml2rfc#797) by [@kesara](https://github.com/kesara))*

- [`f73ece7`](ietf-tools/xml2rfc@f73ece7) - Update setuptools metadata *(PR [#789](ietf-tools/xml2rfc#789) by [@kesara](https://github.com/kesara))*

- [`1643d68`](ietf-tools/xml2rfc@1643d68) - Display long ASCII art correctly in PDF *(PR [#788](ietf-tools/xml2rfc#788) by [@kesara](https://github.com/kesara))*

- [`51e8b24`](ietf-tools/xml2rfc@51e8b24) - Add support for Python 3.10 *(PR [#772](ietf-tools/xml2rfc#772) by [@dkg](https://github.com/dkg))*

- [`46399d7`](ietf-tools/xml2rfc@46399d7) - Implement emboldening primary iref entries *(PR [#778](ietf-tools/xml2rfc#778) by [@cabo](https://github.com/cabo))*

- [`e0095fd`](ietf-tools/xml2rfc@e0095fd) - Remove Python version specific test results *(PR [#780](ietf-tools/xml2rfc#780) by [@kesara](https://github.com/kesara))*

- [`42568b3`](ietf-tools/xml2rfc@42568b3) - evaluate date.today() on class init, not import *(PR [#774](ietf-tools/xml2rfc#774) by [@jennifer-richards](https://github.com/jennifer-richards))*
- [`07ef95e`](ietf-tools/xml2rfc@07ef95e) - Fix warnings in text and manpage *(PR [#775](ietf-tools/xml2rfc#775) by [@kesara](https://github.com/kesara))*

- [`6b32a5d`](ietf-tools/xml2rfc@6b32a5d) - Render text without toc *(PR [#766](ietf-tools/xml2rfc#766) by [@cabo](https://github.com/cabo))*
- [`384399c`](ietf-tools/xml2rfc@384399c) - Display ASCII names for authors in references *(PR [#771](ietf-tools/xml2rfc#771) by [@kesara](https://github.com/kesara))*

- [`8436c2f`](ietf-tools/xml2rfc@8436c2f) - Make index sort case insensitive *(PR [#763](ietf-tools/xml2rfc#763) by [@kesara](https://github.com/kesara))*
- [`0884e8d`](ietf-tools/xml2rfc@0884e8d) - Don't attempt to select initials when fullname contains non Latin characters *(PR [#760](ietf-tools/xml2rfc#760) by [@kesara](https://github.com/kesara))*
- [`9e12093`](ietf-tools/xml2rfc@9e12093) - Make long sourcecode sections breakable *(PR [#764](ietf-tools/xml2rfc#764) by [@kesara](https://github.com/kesara))*

- [`24406e5`](ietf-tools/xml2rfc@24406e5) - Bug fix in tests/input/draft-miek-test.v3.xml *(PR [#738](ietf-tools/xml2rfc#738) by [@kesara](https://github.com/kesara))*
- [`72255eb`](ietf-tools/xml2rfc@72255eb) - Pin PyPDF2 to 2.16.* versions *(PR [#762](ietf-tools/xml2rfc#762) by [@kesara](https://github.com/kesara))*

- [`8fc7efb`](ietf-tools/xml2rfc@8fc7efb) - Update deprecated tox configuration option *(PR [#746](ietf-tools/xml2rfc#746) by [@kesara](https://github.com/kesara))*
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

Successfully merging this pull request may close these issues.

Updates For Weasyprint > 53
4 participants