-
-
Notifications
You must be signed in to change notification settings - Fork 63
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
Require Python 3.10 and Sphinx 7.3 #221
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(There's a conflict after merging #219.)
Looking good, although before merging and pinning 3.11 to 2024.12 in python/cpython#129576, it might be nice to get #218 merged and released in 2025.2, and then pinning 3.11 to 2025.2?
python_docs_theme/__init__.py
Outdated
|
||
return { | ||
"version": "2024.12", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, it would be nice to avoid duplicating the version number here and in pyproject.toml
(ideally I'd like to use something like hatch-vcs or setuptools_scm to avoid hardcoding altogether, as it unlocks more release automation).
If it's important to include the version here, and there's no easy way to avoid duplicating, let's document that this version also needs bumping in the release checklist:
https://github.com/python/python-docs-theme/blob/main/CONTRIBUTING.rst
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally I like the __version__ = '...'
pattern, which would let us do "version": __version__
with no duplication. This can also be picked up by Flit, should we switch to it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we define __version__ = "..."
once somewhere in Python code, and then Flit will pick it up so we don't need it in pyproject.toml
? Yeah, that sounds fine.
(This would also be compatible with hatch-vcs or setuptools_scm, which can generate a version file at build time that you can from ._version import __version__
. But that's out of scope here.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #222 (which also adopts the version-agnostic elements of this PR).
|
||
assert isinstance(app.builder, StandaloneHTMLBuilder) | ||
|
||
if (4,) <= sphinx.version_info < (7, 1) and "css_files" in context: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice lot of cleanup!
# Conflicts: # python_docs_theme/__init__.py # python_docs_theme/static/pydoctheme.css
See also python/cpython#129576. This would mean this theme is no longer installable with the 3.10 or 3.11 branches, which require
sphinx==3.4.3
andsphinx~=7.2.0
respectively.Changes:
_add_asset_hashes
patchsidebar.js_t
for Sphinx 4.xsetup()
theme.conf
to the newtheme.toml
(viapython -m sphinx.theming conf_to_toml python_docs_theme
)version
extension metadata field.@import url(...)
with an entry in thesidebars
list, to allow parallel stylesheet fetching by the user agentA
📚 Documentation preview 📚: https://python-docs-theme-previews--221.org.readthedocs.build/