thesofproject / sof-docs

Documentation for SOF
Other
16 stars 72 forks source link

'ImageDraw' object has no attribute 'textsize' warning with new pillow version 10.0.0 #472

Open marc-hb opened 11 months ago

marc-hb commented 11 months ago

On July 1st, python library "Pillow" (needed by sphinxcontrib.blockdiag) released version 10.0.0 https://pypi.org/project/Pillow/#history

The sof-docs build immediately started to fail with the warning below.

https://github.com/thesofproject/sof/actions/workflows/daily-tests.yml https://github.com/thesofproject/sof/actions/runs/5433906267/jobs/9881925923

WARNING: dot code 'blockdiag edf_scheduling {\n\n\tnode_width = 250;\n\tnode_height = 120;\n\tdefault_fontsize = 16;\n\n\tComp_1 -> Comp_2\n\tcomment_1 -> Comp_2 [style=dashed]\n\tComp_2 -> Comp_3\n\tcomment_2 -> Comp_3 [style=dashed]\n\tComp_3 -> Comp_4\n\tcomment_3 -> Comp_4 [style=dashed]\n\tComp_4 -> sink\n\tcomment_4 -> sink [style=dashed]\n\n\tComp_1 [label="DP component 1\n\n\t\tprocessing period\n\n\t\tcompute requirement"]\n\tComp_2 [label="DP component 2\n\n\t\tprocessing period\n\n\t\tcompute requirement"]\n\tComp_3 [label="DP component 3\n\n\t\tprocessing period\n\n\t\tcompute requirement"]\n\tComp_4 [label="DP component 4\n\n\t\tprocessing period\n\n\t\tcompute requirement"]\n\n\tsink [label="real time sink", shape=endpoint, fontsize = 16]\n\n\tcomment_1 [label="DP1 to deliver data let\n\n\t\tDP2 meet its objective"]\n\tcomment_2 [label="DP2 to deliver data let\n\n\t\tDP3 meet its objective"]\n\tcomment_3 [label="DP3 to deliver data let\n\n\t\tDP4 meet its objective"]\n\tcomment_4 [label="DP4 to deliver data\n\n\t\tto real time-sink"]\n}\n': 'ImageDraw' object has no attribute 'textsize' generating indices... genindex done

Also seen in recent sof-docs PRs: https://github.com/thesofproject/sof-docs/actions/runs/5461579335/jobs/9939764550

To reproduce:

pip3 install -r scripts/requirements.txt
# override the debian package python3-pil or whatever else
pip3 install pillow==10.0.0

Collecting Pillow==10
  Using cached Pillow-10.0.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.3 MB)

# It's just a warning so we need a re-build
make clean
# ... or this shortcut seems to be enough
rm _build/html/architectures/firmware/sof-zephyr/mpp_layer/mpp_scheduling.html
Screenshot 2023-07-10 at 17 01 56
marc-hb commented 11 months ago

Tested, incoming workaround:

pip install 'pillow<10'

marc-hb commented 11 months ago

https://github.com/thesofproject/sof-docs/blob/60a41cf68d6478/architectures/firmware/sof-zephyr/mpp_layer/images/mpp_scheduling/edf_scheduling.diag

Workaround merged:

marc-hb commented 11 months ago

There was a deprecation warning but sphinx has been hiding those:

~Apparently we can't do this anymore~ blockdiag is orphaned and not compatible with Pillow 10 no matter what you do with blockdiag.

blockdiag edf_scheduling {

        node_width = 250;
        node_height = 120;
        ...

This was added by @mwasko in commit 6ec5940222f8.

@mwasko could you check what is the newer way to do this?

marc-hb commented 4 months ago

Bad news: blockdiag is orphaned:

The not-so-bad news: we use blockdiag in a single place for @mwasko's relatively small diagram: 6ec5940222f8a0ec7bdda50c68e4353a476eaa8b

https://thesofproject.github.io/latest/architectures/firmware/sof-zephyr/mpp_layer/mpp_scheduling.html

Could this diagram be re-done using something else? plantUML maybe?

image

lgirdwood commented 4 months ago

@mmaka1 @mwasko any suggestions to replace blockdiag for diagrams ?

marc-hb commented 2 months ago

More discussion in newer #491