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

patching doc extensions to work with later sphinx versions #9556

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

CrosswaveOmega
Copy link

@CrosswaveOmega CrosswaveOmega commented Sep 10, 2023

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).
  • This PR is a breaking change (e.g. methods or parameters removed/renamed)
  • This PR is not a code change (e.g. documentation, README, ...)

backwards compatibility with 4.4.0.
@gribbg
Copy link

gribbg commented Sep 17, 2023

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')

@gribbg
Copy link

gribbg commented Sep 17, 2023

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')

@CrosswaveOmega
Copy link
Author

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.

@Rapptz
Copy link
Owner

Rapptz commented Sep 18, 2023

Rather than doing the compatibility just bump the version along with the changes.

bumping to latest sphinx 7.2.6 version in setup.py
(I hope this is the right way to do it.)
Included a copy of basic.css to prevent visited hyperlinks from turning purple.
favicon now shows up.
@CrosswaveOmega
Copy link
Author

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.

@CrosswaveOmega
Copy link
Author

Added the cosmetic rules to style.css instead.

@CrosswaveOmega CrosswaveOmega marked this pull request as ready for review September 21, 2023 16:46
@No767
Copy link

No767 commented Oct 8, 2023

Might be useful to run docs/extensions/builder.py through black and isort (useless it is already ran through)

@CrosswaveOmega
Copy link
Author

I didn't run black and isort originally, I did so in this commit.

setup.py Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Ready for final review
Development

Successfully merging this pull request may close these issues.

4 participants