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

DeprecationWarning: transform is deprecated, use set_matrix instead (with latest pypdf version) #2318

Closed
ThiefMaster opened this issue Dec 2, 2024 · 4 comments

Comments

@ThiefMaster
Copy link

ThiefMaster commented Dec 2, 2024

../env-312/lib/python3.12/site-packages/weasyprint/document.py:400: in write_pdf
    pdf = generate_pdf(self, target, zoom, **options)
../env-312/lib/python3.12/site-packages/weasyprint/pdf/__init__.py:166: in generate_pdf
    stream.transform(d=-1, f=(page.height * scale))
../env-312/lib/python3.12/site-packages/weasyprint/pdf/stream.py:246: in transform
    super().transform(a, b, c, d, e, f)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <weasyprint.pdf.stream.Stream object at 0x7fdf565aa450>, a = 1, b = 0, c = 0, d = -1, e = 0, f = 841.8897637795276

    def transform(self, a, b, c, d, e, f):
        """transform is deprecated, use set_matrix instead."""
>       warn(Stream.transform.__doc__, DeprecationWarning)
E       DeprecationWarning: transform is deprecated, use set_matrix instead.
@ThiefMaster
Copy link
Author

Another one:

../env-312/lib/python3.12/site-packages/weasyprint/document.py:400: in write_pdf
    pdf = generate_pdf(self, target, zoom, **options)
../env-312/lib/python3.12/site-packages/weasyprint/pdf/__init__.py:190: in generate_pdf
    page.paint(stream, scale)
../env-312/lib/python3.12/site-packages/weasyprint/document.py:99: in paint
    draw_page(self._page_box, stream)
../env-312/lib/python3.12/site-packages/weasyprint/draw.py:67: in draw_page
    draw_stacking_context(stream, stacking_context)
../env-312/lib/python3.12/site-packages/weasyprint/draw.py:170: in draw_stacking_context
    draw_stacking_context(stream, child_context)
../env-312/lib/python3.12/site-packages/weasyprint/draw.py:163: in draw_stacking_context
    draw_inline_level(
../env-312/lib/python3.12/site-packages/weasyprint/draw.py:1230: in draw_inline_level
    draw_text(
../env-312/lib/python3.12/site-packages/weasyprint/draw.py:1278: in draw_text
    emojis = draw_first_line(
../env-312/lib/python3.12/site-packages/weasyprint/draw.py:1356: in draw_first_line
    stream.text_matrix(*matrix.values)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <weasyprint.pdf.stream.Stream object at 0x7fc0bd7a5d60>, a = 1, b = 0, c = 0, d = -1, e = 83.0, f = 97.2578125

    def text_matrix(self, a, b, c, d, e, f):
        """text_matrix is deprecated, use set_text_matrix instead."""
>       warn(Stream.text_matrix.__doc__, DeprecationWarning)
E       DeprecationWarning: text_matrix is deprecated, use set_text_matrix instead.

@liZe
Copy link
Member

liZe commented Dec 3, 2024

Hi!

The new pydyf API is used since dd7cee2, included in WeasyPrint 63.0. If you want to upgrade pydyf, you should upgrade WeasyPrint too!

@ThiefMaster
Copy link
Author

Ah, I see, I got 62.3 because of the pillow<11 issue (so uv pip compile -U does not upgrade weasyprint as long as pillow 11 is in the requirements).

Any ETA on 63.1 btw?

@liZe
Copy link
Member

liZe commented Dec 3, 2024

Any ETA on 63.1 btw?

As soon as the problems introduced by of 63.0 are fixed (at least #2316 and #2312, maybe #2289).

@liZe liZe closed this as not planned Won't fix, can't repro, duplicate, stale Dec 3, 2024
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