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

weasyprint dependency incorrect #94

Closed
loewis opened this issue Oct 31, 2024 · 1 comment
Closed

weasyprint dependency incorrect #94

loewis opened this issue Oct 31, 2024 · 1 comment

Comments

@loewis
Copy link

loewis commented Oct 31, 2024

Currently (2.3.0), django-weasyprint has a dependency to weasyprint>=53. I believe that this is insufficient. I was getting errors
write_pdf() got an unexpected keyword argument 'stylesheets'
After upgrading to weasyprint 63, this error was resolved. I'm not certain which version I had installed before, I believe it was 58. So it appears that the minimum required version must be 59, or even larger.

@fdemmer
Copy link
Owner

fdemmer commented Jan 7, 2025

Thank you for the report! We missed to update the install_requires definition in #71/#70.

While testing this I came across this issue related to pydyf, that has been fixed in WeasyPrint, but I just wanted to reference it here in case someone gets errors like this:

[...]
  File ".../django-weasyprint/django_weasyprint/views.py", line 102, in rendered_content
    return document.write_pdf(**self._options)
  File ".../django-weasyprint/.tox/py310-dj42-wp61-dyf11/lib/python3.10/site-packages/weasyprint/document.py", line 390, in write_pdf
    pdf = generate_pdf(self, target, zoom, **options)
  File ".../django-weasyprint/.tox/py310-dj42-wp61-dyf11/lib/python3.10/site-packages/weasyprint/pdf/__init__.py", line 127, in generate_pdf
    pdf = pydyf.PDF((version or '1.7'), identifier)
TypeError: PDF.__init__() takes 1 positional argument but 3 were given

With pydyf >= 0.11.0 you need WeasyPrint >= 62.0.

@fdemmer fdemmer closed this as completed in 0f8912c Jan 7, 2025
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