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

plugins/sphinx-themes: Fix dependency for Python >=3.12 #52

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SmithChart
Copy link
Member

The sphinx-theme plugin uses pkg_resources to introspect Sphinx. In Python 3.12 pkg_resources is not available by default, because setuptools is not installed to a venv by default.

So starting with 3.12 the plugin is broken.

But setuptools still contains pkg_resources, so we can work around this issue for now by installing setuptools manually. Thus, this change adds this dependency for the sphinx-themes plugin.

This has been tested with Python 3.12 and 3.13 with setuptools up to 75.6.0.

@SmithChart SmithChart self-assigned this Dec 16, 2024
The sphinx-theme plugin uses `pkg_resources` to introspect Sphinx.
In Python 3.12 `pkg_resources` is not available by default, because
`setuptools` is not installed to a venv by default.

So starting with 3.12 the plugin is broken.

But `setuptools` still contains `pkg_resources`, so we can work around
this issue for now by installing `setuptools` manually.
Thus, this change adds this dependency for the `sphinx-themes` plugin.

This has been tested with Python 3.12 and 3.13 with `setuptools` up to 75.6.0.

Signed-off-by: Chris Fiege <[email protected]>
@Bastian-Krause
Copy link
Member

See also python/cpython#101039 and pypa/virtualenv#2487. pkg_resources is deprecated.

What component actually uses pkg_resources? sphinx_rtd_theme does not. Probably old versions of sphinx prior to sphinx-doc/sphinx@6c5c66b? Wouldn't it be better to set the lower limit of sphinx to a version that does not have this issue?

It would be nice to have CI runs for Python 3.12. We should also drop the failing Python 3.7 runs and set fail-fast to false.

@SmithChart
Copy link
Member Author

Our Sphinx-Plugin uses it:

from pkg_resources import iter_entry_points

So it's not a matter of pinning sphinx-doc. We have to fix our plugin at some point. But for as long as setuptools ships this dependency this should work.

Updating the CI sounds like a good idea. Maybe I get around to update #49 to include that.

@Bastian-Krause
Copy link
Member

Our Sphinx-Plugin uses it:

from pkg_resources import iter_entry_points

So it's not a matter of pinning sphinx-doc. We have to fix our plugin at some point. But for as long as setuptools ships this dependency this should work.

Ah, right. As a stop gap solution, the PR looks good to me.

Updating the CI sounds like a good idea. Maybe I get around to update #49 to include that.

Nice!

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

Successfully merging this pull request may close these issues.

2 participants