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

Pillow 10.0.0 removed ImageDraw.textsize #26

Open
flaper87 opened this issue Jul 7, 2023 · 2 comments
Open

Pillow 10.0.0 removed ImageDraw.textsize #26

flaper87 opened this issue Jul 7, 2023 · 2 comments

Comments

@flaper87
Copy link

flaper87 commented Jul 7, 2023

Pillow 10.0.0 removed the textsize method: https://github.com/python-pillow/Pillow/blob/f089c2db8c1806f09e6ed53a1986146693db1ade/docs/releasenotes/10.0.0.rst#font-size-and-offset-methods

This makes something like this fail

.. blockdiag::

  blockdiag foo {
    node_width = 40;
    span_width = 40;
    A <- B <- C <- D <- E;
  }

with the following error:

Warning, treated as error:
dot code 'blockdiag foo {\n  node_width = 40;\n  span_width = 40;\n  A <- B <- C <- D <- E;\n}': 'ImageDraw' object has no attribute 'textsize'
nox > Command sphinx-build -E -W -d doc/build/doctrees -b html doc/source/ doc/build/html failed with exit code 2
nox > Session docs failed.
@radarhere
Copy link

From what I see, sphinxcontrib-blockdiag doesn't use Pillow directly, but rather it uses reportlab which uses Pillow.

https://www.reportlab.com/about/contact/ suggests that you contact reportlab-users@lists2.reportlab.com

@johnsom
Copy link

johnsom commented Jul 13, 2023

FYI, there is a PR for this issue: blockdiag/blockdiag#171

openstack-mirroring pushed a commit to openstack/keystone-specs that referenced this issue Jan 10, 2025
Replace unmaintained `sphinxcontrib-*diag` with `graphviz` in order to
fix not building docs (e.g. with `tox -e docs` or in CI) after upgrade
of `pillow` in upper-constraints.txt of openstack/requirements [1]
(pulled as dependency of `sphinxcontrib-*diag` [2]).
The change is similar to how other OpenStack services did it (e.g.
Keystone [3] + Partial-Bug #2026345).

Some diagrams (specifically `seqdiag`) is difficult to migrate
preserving readability, thus they are replaced with corresponding static
images from the latest published build `0.0.1.dev621`, given that specs
are not expected to be updated once merged.

Other included changes are to fix the gates, and also require some
recent supported Python versions.

[1] https://opendev.org/openstack/requirements/commit/64747a5e55d48caa5ce2fb3cfbc76e3665293b32
[2] blockdiag/sphinxcontrib-blockdiag#26
[3] https://review.opendev.org/c/openstack/keystone/+/935685

Partial-Bug: #2026345
Change-Id: I23e71b07632f3d3ec705e2346c0d6c69c6643361
Signed-off-by: Stanislav Zaprudskiy <s.zaprudskiy@sap.com>
openstack-mirroring pushed a commit to openstack/openstack that referenced this issue Jan 10, 2025
* Update keystone-specs from branch 'master'
  to 46c7b05459de06327053fe31eb3eb569936383dd
  - Replace `sphinxcontrib-*diag` with `graphviz`
    
    Replace unmaintained `sphinxcontrib-*diag` with `graphviz` in order to
    fix not building docs (e.g. with `tox -e docs` or in CI) after upgrade
    of `pillow` in upper-constraints.txt of openstack/requirements [1]
    (pulled as dependency of `sphinxcontrib-*diag` [2]).
    The change is similar to how other OpenStack services did it (e.g.
    Keystone [3] + Partial-Bug #2026345).
    
    Some diagrams (specifically `seqdiag`) is difficult to migrate
    preserving readability, thus they are replaced with corresponding static
    images from the latest published build `0.0.1.dev621`, given that specs
    are not expected to be updated once merged.
    
    Other included changes are to fix the gates, and also require some
    recent supported Python versions.
    
    [1] https://opendev.org/openstack/requirements/commit/64747a5e55d48caa5ce2fb3cfbc76e3665293b32
    [2] blockdiag/sphinxcontrib-blockdiag#26
    [3] https://review.opendev.org/c/openstack/keystone/+/935685
    
    Partial-Bug: #2026345
    Change-Id: I23e71b07632f3d3ec705e2346c0d6c69c6643361
    Signed-off-by: Stanislav Zaprudskiy <s.zaprudskiy@sap.com>
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

3 participants