Repository navigation
fix(ci): drop unused type: ignore comments and handle fonts without sCapHeight so CI passes on main - #7
Open
weitheng wants to merge 2 commits into
Open
fix(ci): drop unused type: ignore comments and handle fonts without sCapHeight so CI passes on main#7weitheng wants to merge 2 commits into
weitheng wants to merge 2 commits into
Conversation
…nused, so strict mypy passes again
…as no sCapHeight, so the Arabic corpus builder works with DejaVu Sans on Linux
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What breaks
CI on
mainhas failed on every job since 22 Jul(https://github.com/AryanBV/pdf-edit-engine/actions/runs/29895356358): the Typecheck step stops
with 21
Unused "type: ignore" comment [unused-ignore]errors, so the tests never run. WithTypecheck passing, the two Linux jobs then fail
test_builder_yields_parseable_pdf[build_arabic_pdf]andtest_builder_is_deterministic[build_arabic_pdf]withAttributeError: 'table_O_S_2f_2' object has no attribute 'sCapHeight'.Why
pikepdf.Objectoperations (list(obj),del obj[key],.get()).pikepdf 10.6.0 added type hints for them and 10.8.0 covered the last one, so strict mypy
(
warn_unused_ignores) flags each one. CI installs the newest releasepikepdf>=10,<11allows(10.17.0 today). mypy and fontTools are not the cause: the count is 21 with mypy 1.20.2, 2.2.0
and 2.4.1.
has no
sCapHeight.Fix
sCapHeightwith the fallbacktests/invariants/test_g_10_latin_reflow_lock.pyandtests/invariants/test_g_9_cjk_linebreak.pyalready use,getattr(os2, "sCapHeight", os2.sTypoAscender), at the five places that read it directly:tests/corpus_builders/_truetype_assembler.py,tests/corpus_builders/no_tounicode.py,tests/_identity_h_fixture.py,tests/_simple_font_fixture.pyandtests/generate_complex_corpus.py.Testing
python -m mypyon this branch: no issues with pikepdf 10.17.0 and mypy 2.4.1, and none withpikepdf 10.8.0. pikepdf 10.6 and 10.7 still report one error (
annotations.py,del obj[...])and 10.0 to 10.5 one to three, as before this change.
ruff check src/ tests/on this branch: all checks passed.main, whose Arabic builder files are identical to thisbranch's: CI passed on ubuntu-latest and windows-latest with Python 3.12 and 3.13
(https://github.com/weitheng/pdf-edit-engine/actions/runs/41257182374).