patching doc extensions to work with later sphinx versions
fix for doc/extensions/builder.py to allow for compatibility with sphinx 7.2.5 and up.
Summary
Checklist
- [X ] If code changes were made then they have been tested.
- [X ] I have updated the documentation to reflect the changes.
- [ ] This PR fixes an issue.
- [ ] This PR adds something new (e.g. new method or parameters).
- [x] This PR is a breaking change (e.g. methods or parameters removed/renamed)
- [x] This PR is not a code change (e.g. documentation, README, ...)
I'm running into this same issue.
Note that .astimezone() can provide access to the local timezone:
>>> datetime.datetime.now().astimezone().tzinfo
datetime.timezone(datetime.timedelta(days=-1, seconds=72000), 'Eastern Daylight Time')
Actually, it's probably best to just use the old code in the except block:
except Exception as exc:
from sphinx.buildert.gettext import timestamp, ltz
ctime = datetime.datetime.fromtimestamp(timestamp, ltz).strftime('%Y-%m-%d %H:%M%z')
I was considering replacing the ctime calculation used in the except block with the ctime calculation used in the later sphinx build, but your way would work out better.
Rather than doing the compatibility just bump the version along with the changes.
Outside of a deprecation warning for status_iterator (which I patched), the extensions now work with the latest sphinx version (7.2.6).
The only thing left is to resolve any cosmetic/front end issues caused by bumping the sphinx version.
Added the cosmetic rules to style.css instead.
Might be useful to run docs/extensions/builder.py through black and isort (useless it is already ran through)
I didn't run black and isort originally, I did so in this commit.