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

[CI] ReadTheDocs is broken #1726

Closed
kif opened this issue Aug 28, 2022 · 2 comments
Closed

[CI] ReadTheDocs is broken #1726

kif opened this issue Aug 28, 2022 · 2 comments

Comments

@kif
Copy link
Member

kif commented Aug 28, 2022

Primary investigation go to the upgrade of "Pygment" (2.13.0)
This does use "importlib_metadata" on Python3.7 (version used on RTD.
The trick provided in their documentation (use pip install pygments[plugins]) does sometimes work, sometimes not.
On the platform where RTD runs and on Debian9 to does not work.
On Conda environment with py37 it does work.

Minimal script for reproducibility:

#!/usr/bin/env python
import importlib_metadata
importlib_metadata.entry_points()

which leads to

 importlib_metadata.entry_points()
  File "/tmp/rtd/py37/lib/python3.7/site-packages/importlib_metadata/__init__.py", line 1051, in entry_points
    return SelectableGroups.load(eps).select(**params)
  File "/tmp/rtd/py37/lib/python3.7/site-packages/importlib_metadata/__init__.py", line 477, in load
    ordered = sorted(eps, key=by_group)
  File "/tmp/rtd/py37/lib/python3.7/site-packages/importlib_metadata/__init__.py", line 1048, in <genexpr>
    dist.entry_points for dist in _unique(distributions()
  File "/tmp/rtd/py37/lib/python3.7/site-packages/importlib_metadata/_itertools.py", line 17, in unique_everseen
    k = key(element)
  File "/tmp/rtd/py37/lib/python3.7/site-packages/importlib_metadata/__init__.py", line 962, in _normalized_name
    or super()._normalized_name
  File "/tmp/rtd/py37/lib/python3.7/site-packages/importlib_metadata/__init__.py", line 629, in _normalized_name
    return Prepared.normalize(self.name)
  File "/tmp/rtd/py37/lib/python3.7/site-packages/importlib_metadata/__init__.py", line 884, in normalize
    return re.sub(r"[-_.]+", "-", name).lower().replace('-', '_')
  File "/usr/lib/python3.7/re.py", line 192, in sub
    return _compile(pattern, flags).sub(repl, string, count)
TypeError: expected string or bytes-like object
@kif
Copy link
Member Author

kif commented Aug 28, 2022

Looks like importlib_metadata.entry_points() is OK just before RTD does a python ./setup.py install --force

@kif
Copy link
Member Author

kif commented Aug 28, 2022

I tried to replace python ./setup.py install --force by a pip install . in a fresh environment, it works.
As soon as I install the package with setup.py, importlib_metadata.entry_points() breaks.

So I suppose the bug is in the procedure from RTD.

There is an issue open whether it makes sense to replace python ./setup.py install --force with an upgraded version based on pip. I believe the time has come ...
readthedocs/readthedocs.org#8659

@kif kif closed this as completed Aug 30, 2022
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

1 participant