docs: fix conf after _build.py changes#4647
Closed
mjg wants to merge 1 commit into
Closed
Conversation
`docs/conf.py` tries to read version info from `src/__init__py` using an expression match. This breaks after e439a0f ("setup.py src/ tests/: auto-generate pymupdf.pymupdf_version and add git info.", 2025-08-08) makes `src/__init__py` import that info from `_build.py`, which is generated during build in the build directory. Make the build process generate a copy of `_build.py` in `docs` and let `docs/conf.py` import version info from there. Alternative fixes: - pointing `docs/conf.py` at the build directory; this may no longer exist after a wheel build, though - reading from the generated wheel; oh well ;-) - installing the build and importing `_build.py` from there; this would mean intermingling build and install steps
Collaborator
|
Thanks for this. Oddly enough i came across the same problem earlier today. My fix is slightly different - it makes I think this is slightly better because it doesn't require that a build has been done. And it gets the required information directly from the primary source |
Contributor
Author
|
If that has no unwanted side-effects it should be fine. I saw no commit fixing this, that's why I went ahead. |
Contributor
Author
|
Works with your patch, btw, so I'll close this one. Thanks! |
Collaborator
|
Thanks, we've merged the docs fix. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
docs/conf.pytries to read version info fromsrc/__init__pyusing an expression match. This breaks after e439a0f ("setup.py src/ tests/: auto-generate pymupdf.pymupdf_version and add git info.", 2025-08-08) makessrc/__init__pyimport that info from_build.py, which is generated during build in the build directory.Make the build process generate a copy of
_build.pyindocsand letdocs/conf.pyimport version info from there.Alternative fixes:
docs/conf.pyat the build directory; this may no longer exist after a wheel build, though_build.pyfrom there; this would mean intermingling build and install steps