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

Revert the removal of sphinx.util:force_decode() #9326

Merged
merged 2 commits into from Jun 30, 2021

Conversation

tk0miya
Copy link
Member

@tk0miya tk0miya commented Jun 13, 2021

Feature or Bugfix

  • Feature
  • Refactoring

Purpose

  • After the release of 4.0.0, some 3rd party extensions have became not
    working with the latest Sphinx because force_decode() function was
    removed. It was deprecated since Sphinx-2.0 and warned for the removal
    since 3.0.
  • This reverts the removal and extends its deprecation period to 5.0.0. I
    hope it helps users of these extensions.
  • refs: Deprecate and drop internal use of force_decode() #5620 (comment)
  • cc: @stevepiercy

@tk0miya tk0miya added this to the 4.0.3 milestone Jun 13, 2021
After the release of 4.0.0, some 3rd party extensions have became not
working with the latest Sphinx because `force_decode()` function was
removed.  It was deprecated since Sphinx-2.0 and warned for the removal
since 3.0.

This reverts the removal and extends its deprecation period to 5.0.0.  I
hope it helps users of these extensions.
@stevepiercy
Copy link
Contributor

@tk0miya thank you for this reversion.

I want to migrate sphinx.ext.autodoc.AutoDirective to application.Sphinx.add_autodocumenter(), but an upgrade path is not clear to me. If anyone has a before/after upgrade commit in their project to share with me, I would greatly appreciate it.

@tk0miya tk0miya merged commit 779d902 into sphinx-doc:4.0.x Jun 30, 2021
@tk0miya tk0miya deleted the rebirth_of_force_decode branch June 30, 2021 12:19
@tk0miya
Copy link
Member Author

tk0miya commented Jun 30, 2021

Merged.

@stevepiercy Could you let me know in detail? AFAIK, AutoDirective class had been used to build the autodoc framework. It's not for extension. So I can't imagine how the extension using it.

@stevepiercy
Copy link
Contributor

@tk0miya I believe that AutoDirective is used to test the extension repoze.sphinx.autointerface, but is not used by the extension itself. AutoDirective appears in two places in the test code. I would like to understand how to rewrite these tests.

@tk0miya
Copy link
Member Author

tk0miya commented Jul 3, 2021

We also have similar code named do_autodoc() here:
https://github.com/sphinx-doc/sphinx/blob/4.x/tests/test_ext_autodoc.py#L33-L43

I think you can do testing with this helper.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants