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

Enable testing with Sphinx 7.2+ (also on Python 3.12) #28

Merged
merged 4 commits into from
Jan 13, 2024

Conversation

befeleme
Copy link
Contributor

@befeleme befeleme commented Nov 2, 2023

I can't use patch from #27 in Fedora, because we already build packages with Python 3.12, and the internals of pathlib.Path were rewritten. See traceback below.

I tried to understand what is the desired outcome of the tests here and since Sphinx is heading towards the standard Path objects, there's no need to monkeypatch the attributes anymore: the Path.resolve() method does the relevant work for us.
Also, adding tests with Python 3.12 since it's already out.

_________________________________________ test_jquery_installed_sphinx_ge_60 __________________________________________

blank_app = <function blank_app.<locals>.inner at 0x7f2ef84f7560>

    @pytest.mark.skipif(sphinx.version_info[:2] < (6, 0),
                        reason="Requires Sphinx 6.0 or greater")
    def test_jquery_installed_sphinx_ge_60(blank_app):
>       out_dir = blank_app(confoverrides={"extensions": ["sphinxcontrib.jquery"]})

tests/test_jquery_installed.py:67: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_jquery_installed.py:38: in inner
    return run_blank_app(Path(tmpdir), **kwargs)
tests/test_jquery_installed.py:19: in run_blank_app
    app = SphinxTestApp(**kwargs, srcdir=srcdir)
../venv213/lib64/python3.12/site-packages/sphinx/testing/util.py:120: in __init__
    super().__init__(srcdir, confdir, outdir, doctreedir,
../venv213/lib64/python3.12/site-packages/sphinx/application.py:152: in __init__
    self.srcdir = _StrPath(srcdir).resolve()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = FakePath('/tmp/pytest-of-ksurma/pytest-4/test_jquery_installed_sphinx_g1'), args = (), kwargs = {}

    def resolve(self, *args, **kwargs):
>       return self._path
E       AttributeError: 'FakePath' object has no attribute '_path'. Did you mean: '_hash'?

@befeleme befeleme marked this pull request as draft November 2, 2023 09:54
@befeleme
Copy link
Contributor Author

befeleme commented Nov 2, 2023

Ok, compatibility is an issue -switching to draft.

@befeleme befeleme force-pushed the sphinx-7.2 branch 4 times, most recently from b345516 to cb601c4 Compare November 3, 2023 09:54
@befeleme befeleme marked this pull request as ready for review November 3, 2023 09:57
matoro added a commit to matoro/gentoo that referenced this pull request Nov 23, 2023
matoro added a commit to matoro/gentoo that referenced this pull request Nov 24, 2023
matoro added a commit to matoro/gentoo that referenced this pull request Nov 24, 2023
gentoo-bot pushed a commit to gentoo/gentoo that referenced this pull request Nov 24, 2023
See: sphinx-contrib/jquery#28
Closes: https://bugs.gentoo.org/911837
Signed-off-by: Matoro Mahri <matoro_gentoo@matoro.tk>
Signed-off-by: Sam James <sam@gentoo.org>
Since Sphinx is heading towards the standard Path objects, there's
no need to monkeypatch the attributes anymore: the Path.resolve()
method does the relevant work for us.
@AA-Turner AA-Turner merged commit 80d1d39 into sphinx-contrib:master Jan 13, 2024
25 of 32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants