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

Add support for building documentation with latest sphinx #2695

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

Conversation

neofelis2X
Copy link

@neofelis2X neofelis2X commented Feb 8, 2025

As discussed in #2672, this unpins sphinx and makes building the documentation with latest sphinx (currently 8.2.1) possible.
A current build of the documentation can be viewed here. This test page will be deleted later.

The sphinx build process was tested locally with macOS and Windows, with python 3.9 and 3.13.

To get the docs to look and work as before, a few fixes were needed. Mostly changes to the sphinx config and the post-processing script.

A rough overview of the changes:

  • Update to Doxygen 1.9.1
  • Doxygen for windows now comes with libclang.dll
    • getTool is now able to load also .tar.bz2 files
  • getting back jQuery with "sphinxcontrib.jquery"
  • fixed a deprecated getargspec function
  • doc2dash --name flag needs the full name with extension
  • some tweaking of the theme (css)
  • some fixes where the ReStructuredText was incorrect
  • in windows sphinx couldn't load images from a windows path in ReST files
  • wxStyledTextCtrl has many methods, which are now sorted and linked correctly
  • the postprocessing script needed to be updated because it alters the output html files directly
  • The inheritance diagrams are now created as .svg including small design changes to increase their readability
See new look of inheritance diagrams

inh_diags

Fixes #2672
Fixes #2608
Fixes #2625

Edit: Updated inheritance diagrams and added a screenshot here.
Edit 2: Added missing dependencies and tested with latest sphinx.

@neofelis2X
Copy link
Author

Ok so I looked into why the build workflow failed.

The Problem:

The "new" doxygen version is linked against clang-9 and that is missing. Furthermore, the host Ubuntu 22.04 doesn't even support clang-9 anymore. My bad, sorry, I didn't know that.

The good news:

Ubuntu 22.04 has doxygen 1.9.1 as a package. This binary is linked against clang-14 and it works.

My proposed solution:

  1. Upload the ubuntu binary to wxPython-tools. Then we have a functional version there.
  2. Install apt install doxygen in the github workflow - then we have all needed dependencies

Please let me know what you think of that. I'm not much of a linux person, but that's how I would solve this complication.

@echoix
Copy link
Contributor

echoix commented Feb 10, 2025

Does doxygen work correctly with a static build? Is it tied to llvm?

@neofelis2X
Copy link
Author

I didn't try that, should work in theory.

@swt2c
Copy link
Collaborator

swt2c commented Feb 11, 2025

1. Upload the ubuntu binary to `wxPython-tools`. Then we have a functional version there.

I don't think we should just upload the ubuntu binary to wxPython tools. Then it technically might work in our CI but it won't work for anyone else. Ideally, we would use a statically linked doxygen that doesn't require external dependencies (or I suppose include the dependencies?) which is how the current doyxgen build works. It would be nice if we could keep that property.

@neofelis2X
Copy link
Author

Sphinx 8.2.0 recently dropped support for Python 3.10. The workflow is using python 3.9.
Can we bump the workflow for the docs to python 3.11? Build wxPython documentation

@echoix
Copy link
Contributor

echoix commented Feb 26, 2025

The furthest you can go, the more headroom we have until it gets dropped again, and probably better support for inspecting type annotations (I assume). And 3.11 had great performance improvements, the others still improve a bit, but 3.11 was a great step

@swt2c
Copy link
Collaborator

swt2c commented Feb 26, 2025

I agree, feel free to bump it up (to 3.13 even!).

@neofelis2X
Copy link
Author

neofelis2X commented Feb 27, 2025

Great, 3.13 it is then. I tested the build with 3.13 on windows and macos, so that should be good.

@@ -259,6 +260,7 @@ def run():
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.runGenerators(module)
postprocess.categorise_methods()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like the sdist build is failing on CI/CD due to this change. Is this really the right place where this should run? It seems like it is depending on the docs having been built already?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants