-
Notifications
You must be signed in to change notification settings - Fork 81
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
Build fails for release and forks, advice? #70
Comments
Hi Anton ! I encountered the same problem with the sphinxcontrib-versioning 2.2.1 from pypi. Even if I solved my problem in #66 I'm still stuck like you mentioned above. |
Hi there, after digging around for 1 hour, I found a simple hack should work for this case.
Change the Currently by default |
Thanks! Going to test it out later today! |
@tetov sorry for post a wrong solution, it's for another bug. BTW I encountered the same freezing bug too. |
There are several things to make it work in my setting up.
It should work now. |
I've used fresh install from the main by following the two points above (I manually patched the sphinx.py) and then also also the ImportError: cannot import name 'build_main' fix The HTML pages are in /tmp/tmpbuild directory This error occurs with my real project and also with the tutorials simple example (https://sphinxcontrib-versioning.readthedocs.io/en/latest/tutorial.html#build-all-versions) |
You can try add some log lines in these callbacks to see if this extension is registered correctly.
|
Any progress in this? I have this same problem. |
I added simple print commands to see if the two functions were called and finished. |
@vancheese Then the extension itself is not registered properly. Can you post the |
I've identified where the program freeze config = queue.get() |
I've been hit by this as well and tried to figure out what broke in which sphinx versions. I've used the Docker sphinx that I maintain for this and used the "quick-and-dirty" documentation from the tutorial for testing.
Version 2.0.1 is the first version where I observed the hang/freeze. Apart from the sphinx version, there are no other differences between my Docker images for 2.0.0 and 2.0.1. The changes between those two don't provide any clue, to me at least, what might have triggered this. |
@paddy-hack The changes I spoke about in my last comment work on sphinx 2.2.1 too |
Hi, i'm using the fork: https://github.com/Smile-SA/sphinx-versions installed from pip and all of the above patches are already applied but it still hangs from sphinx-2.0.1. Have anyone tried this library? @GlitchyPSIX does it work for you with patches you mentioned? #46 and #66 |
@dlopezlo Yes (sphinx 2.2.1), I have managed to get sphinxcontrib-versioning building properly by applying #46, #66, and the Do remember to add the I made a separate |
As for adding the |
Adding Fix confirmed to work on 2.0.1, 2.1.0, 2.1.2, 2.2.0 and 2.2.1 using the tutorial example with the extension added to |
After applying all those fixes I get the message:
Does anyone have the same issue? Or did I maybe do something wrong? |
My workaround for this is just a second |
I'm aware of your work around but that doesn't solve thing for documentation versions that have already been committed and pushed 😢 |
@fmmix I got the same error when accidently running |
@GlitchyPSIX I've resorted to conditionally added the extension based on an environment variable. Since I normally only want to run if 'CI' in os.environ and os.environ['CI'] == 'true':
extensions.append('sphinxcontrib.versioning.sphinx_') Works For Me 😄 |
@paddy-hack Haha, yeah, figured this would be a solution In the end that's kind of what I achieved with the second Maybe your solution can work for others facing this issue? Looks a bit more catch-all than my local-based case. |
It took me a while but I finally figured it out for good. I will not make a PR because I find the fix to be especially ugly but I leave it there as a git patch for those encountering the issue. The bug happens starting from Sphinx 2.0.1 as some noticed and is due to the fact that the My UGLY hotfix bypasses the Index: sphinxcontrib/versioning/sphinx_.py
<+>UTF-8
===================================================================
--- sphinxcontrib/versioning/sphinx_.py (revision f286d43595d75c08cb51a0153a9cdf3b8a1957b3)
+++ sphinxcontrib/versioning/sphinx_.py (date 1582638010030)
@@ -184,8 +184,13 @@
:param str current_name: The ref name of the current version being built.
:param bool is_root: Is this build in the web root?
"""
- # Patch.
- application.Config = ConfigInject
+ # Update monkey patch to work with Sphinx 2.0.1+ _ModuleWrapper addition around sphinx.application due to
+ # CONFIG_FILENAME deprecation.
+ # _ModuleWrapper does not redirect __setattr__ calls to the underlying module so we need to bypass it to inject
+ # the extension.
+ # This is ugly and will break starting from at least Sphinx 3.0+ but the idea of monkey patching the extension
+ # silently into sphinx was hackish at most to begin with.
+ application._module.Config = ConfigInject # noqa
if config.show_banner:
EventHandlers.BANNER_GREATEST_TAG = config.banner_greatest_tag
EventHandlers.BANNER_MAIN_VERSION = config.banner_main_ref
|
I needed a versioning tool for Sphinx but all existing projects that I found didn't work properly and their code was messy, so I decided to implement my own solution and published it here: https://holzhaus.github.io/sphinx-multiversion/master/index.html |
Hi!
I understand that the status of sphinxcontrib-versioning is a bit complicated, but I gather from reading from the issues and PRs and from looking at a few doc setups that people have this working. I was wondering if someone could help me with an issue I haven't found reported here on the repo.
Running
sphinx-versioning build
with the pypi version I get the error documented in issue #66 fixed in PR #69. However, running @z00sts' PR branch quits with a file not found error.I've also tried @leokoppel's fork, but there it hangs after two runs of doc building and no files found in the reported path (
/tmp/tmp*sphinxcontrib_versioning
).Anyone encountered something similar or could give some points towards getting this to work with compas-dev/compas?
General info
Logs
The text was updated successfully, but these errors were encountered: