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

chore(deps): Update WeasyPrint to v64.0 #1215

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ jobs:
echo "Installing pip + wheel..."
python -m pip install --upgrade pip wheel
echo "Installing test dependencies..."
python -m pip install tox tox-gh-actions certifi decorator dict2xml pyflakes "pypdf>=4.1.0" "weasyprint==61.2" "pydyf<0.10.0"
python -m pip install tox tox-gh-actions certifi decorator dict2xml pyflakes "pypdf>=4.1.0" "weasyprint==64.0"

- name: Generate Valid Tests
run: |
Expand Down Expand Up @@ -156,7 +156,7 @@ jobs:
echo "Installing pip + wheel..."
python -m pip install --upgrade pip wheel
echo "Installing test dependencies..."
python -m pip install tox tox-gh-actions certifi decorator dict2xml pyflakes "pypdf>=4.1.0" "weasyprint==61.2" "pydyf<0.10.0"
python -m pip install tox tox-gh-actions certifi decorator dict2xml pyflakes "pypdf>=4.1.0" "weasyprint==64.0"

- name: Generate Valid Tests
run: |
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ documentation = "https://ietf-tools.github.io/xml2rfc/"
issues = "https://github.com/ietf-tools/xml2rfc/issues"

[project.optional-dependencies]
pdf = ["weasyprint==61.2", "pydyf<0.10.0"]
pdf = ["weasyprint==64.0"]

[project.scripts]
xml2rfc = "xml2rfc.run:main"
Expand Down
3 changes: 1 addition & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,4 @@ deps =
decorator
dict2xml
pypdf>=4.1.0
weasyprint==61.2
pydyf<0.10.0
weasyprint==64.0
35 changes: 14 additions & 21 deletions xml2rfc/writers/pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,27 +42,20 @@ def __init__(self, xmlrfc, quiet=None, options=default_options, date=None):

logging.basicConfig(level=logging.INFO)

# Weasyprint logger
wplogger = logging.getLogger('weasyprint')
if self.options.quiet:
wplogger.setLevel(logging.CRITICAL)
elif self.options.verbose:
wplogger.setLevel(logging.WARNING)
elif self.options.debug:
wplogger.setLevel(logging.DEBUG)
else:
wplogger.setLevel(logging.ERROR)

# fontTools logger
ftlogger = logging.getLogger('fontTools')
if self.options.quiet:
ftlogger.setLevel(logging.CRITICAL)
elif self.options.verbose:
ftlogger.setLevel(logging.WARNING)
elif self.options.debug:
ftlogger.setLevel(logging.DEBUG)
else:
ftlogger.setLevel(logging.ERROR)
loggers = []
loggers.append(logging.getLogger("weasyprint"))
loggers.append(logging.getLogger("fontTools.subset"))
loggers.append(logging.getLogger("fontTools.ttLib"))
loggers.append(logging.getLogger("fontTools.varlib"))
for _logger in loggers:
if self.options.quiet:
_logger.setLevel(logging.CRITICAL)
elif self.options.verbose:
_logger.setLevel(logging.WARNING)
elif self.options.debug:
_logger.setLevel(logging.DEBUG)
else:
_logger.setLevel(logging.ERROR)

def pdf(self):
if not weasyprint:
Expand Down
Loading