breathe
breathe copied to clipboard
Fix PosixPath issue with Sphinx 7.2
Just need to cast the path to a string.
Fixes https://github.com/breathe-doc/breathe/issues/944
hi, I think you have the same fix but in other way in https://github.com/breathe-doc/breathe/pull/956
I spoke too soon , I use this fix instead of first change on commit of https://github.com/breathe-doc/breathe/pull/956
@jakobandersen sorry for the ping, but I believe you are a maintainer of Breathe -- do you think this PR would be mergeable? It's one of the main things preventing Sphinx 8.0 at the moment.
A
Actually, the fix from #956 is more complete. Notably, the tests still fail with this one, so it's not even really "testable".
Ah, fair enough -- though I don't believe #956 will work on older versions of Sphinx, it should use the Path
constructor instead of assuming .parent
exists.
A
Are you asking me to open a fourth competing pull request? ;-)
I be clear I use this one, more [1] found in #956
[1]
diff --git a/tests/test_renderer.py b/tests/test_renderer.py
index a858c65d..73a29e4e 100644
--- a/tests/test_renderer.py
+++ b/tests/test_renderer.py
@@ -35,7 +35,11 @@ def app(test_params, app_params, make_app, shared_result):
"""
args, kwargs = app_params
assert "srcdir" in kwargs
- kwargs["srcdir"].makedirs(exist_ok=True)
+ try:
+ kwargs["srcdir"].mkdir(parents=True, exist_ok=True)
+ except AttributeError:
+ # old version of Sphinx
+ kwargs["srcdir"].makedirs(exist_ok=True)
(kwargs["srcdir"] / "conf.py").write_text("")
app_ = make_app(*args, **kwargs)
yield app_