Issue with Twine + python 3.9
The command bdt ci readme ....
is consistently failing on linux with python 3.9
https://gitlab.idiap.ch/bob/bob.extension/-/jobs/264169 https://gitlab.idiap.ch/bob/bob.bio.video/-/jobs/264064 https://gitlab.idiap.ch/bob/bob.bio.face/-/jobs/264052
This command basically does a sanity check on the long_description
field of the setup.py
.
In our case, this field is filled with the content of README.rst.
For this check, the command uses a library called readme_renderer
, which calls a function from bleach
Well, in short, there is an API issue readme_renderer
and this breaks all our builds
File "/scratch/builds/bob/bob.bio.video/miniconda/lib/python3.9/site-packages/twine/commands/check.py", line 121, in check
warnings, is_ok = _check_file(filename, render_warning_stream)
File "/scratch/builds/bob/bob.bio.video/miniconda/lib/python3.9/site-packages/twine/commands/check.py", line 92, in _check_file
rendering_result = renderer.render(
File "/scratch/builds/bob/bob.bio.video/miniconda/lib/python3.9/site-packages/readme_renderer/rst.py", line 114, in render
return clean(rendered)
File "/scratch/builds/bob/bob.bio.video/miniconda/lib/python3.9/site-packages/readme_renderer/clean.py", line 72, in clean
cleaner = bleach.sanitizer.Cleaner(
TypeError: __init__() got an unexpected keyword argument 'styles'
There is wrong pinning of bleach on readme_renderer
.
This can be solved by updating the readme_renderer
version from conda-forge
, which currently is 27.0, but they already have a tagged the version 34.0 (https://github.com/pypa/readme_renderer/releases/tag/34.0)