Skip to content

Remove support for the Sphinx 0.5 intersphinx_mapping format - #12083

Merged
AA-Turner merged 19 commits into
sphinx-doc:masterfrom
picnixz:core/deprecate-intersphinx-1-0
Jul 22, 2024
Merged

AA-Turner merged 19 commits into
sphinx-doc:masterfrom
picnixz:core/deprecate-intersphinx-1-0

Conversation

@picnixz

@picnixz picnixz commented Mar 14, 2024

Copy link
Copy Markdown
Member

Extracted from #11706.

cc @jayaddison

Comment thread sphinx/ext/intersphinx.py Resolved
Comment thread sphinx/ext/intersphinx.py Resolved
Comment thread sphinx/ext/intersphinx.py Resolved
Comment thread sphinx/ext/intersphinx.py Resolved
@AA-Turner
AA-Turner force-pushed the core/deprecate-intersphinx-1-0 branch from 5203786 to 472eeab Compare April 25, 2024 15:34
@AA-Turner

Copy link
Copy Markdown
Member

Have rebased this on the now-split intersphinx package.

A

@picnixz picnixz mentioned this pull request Jul 20, 2024

@AA-Turner AA-Turner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good -- main high-level feedback is that we should now be stricter on rejecting invalid formats (and add appropriate tests that ConfigError is raised)

A

Comment thread sphinx/ext/intersphinx/_load.py Resolved
@AA-Turner AA-Turner changed the title [8.x] deprecate intersphinx format Remove support for Sphinx 0.x intersphinx format Jul 20, 2024
@AA-Turner AA-Turner modified the milestones: 8.x, 8.0.0 Jul 20, 2024
Comment thread sphinx/ext/intersphinx/_load.py Resolved
Comment thread sphinx/ext/intersphinx/_load.py Resolved
Comment thread sphinx/ext/intersphinx/_load.py Resolved
Comment thread sphinx/ext/intersphinx/_load.py Resolved
@jayaddison

Copy link
Copy Markdown
Contributor

Do we need to update ENV_VERSION with this change?

@picnixz

picnixz commented Jul 22, 2024

Copy link
Copy Markdown
Member Author

Do we need to update ENV_VERSION with this change?

I don't know but to be sure, let's do it :)

@AA-Turner

Copy link
Copy Markdown
Member

Do we need to update ENV_VERSION with this change?

We shouldn't need to, as the resulting data that gets stored in the environment is unchanged -- we haven't changed how we do the normalisation.

A

@picnixz

picnixz commented Jul 22, 2024 •

Copy link
Copy Markdown
Member Author

Actually, by doing so, it would at least invalidate the cache (which could contain old intersphinx references). But if you want, you can revert the last commit (just tell me whether it's you or me that need to work on the branch now; I don't want race issues)

@AA-Turner

Copy link
Copy Markdown
Member

just tell me whether it's you or me that need to work on the branch now

I'm done for now, don't worry

@jayaddison

Copy link
Copy Markdown
Contributor

@jayaddison

Do we need to update ENV_VERSION with this change?

@AA-Turner

We shouldn't need to, as the resulting data that gets stored in the environment is unchanged -- we haven't changed how we do the normalisation.

@picnixz

Actually, by doing so, it would at least invalidate the cache (which could contain old intersphinx references). But if you want, you can revert the last commit (just tell me whether it's you or me that need to work on the branch now; I don't want race issues)

Ok. Perhaps reverting it here, but adding it in #12087 could make sense? Reasoning: it could be unexpected to have resolved non-deterministic inventories, and yet not rewrite existing environment files affected by that after an upgrade to 8.x takes place.

@picnixz

picnixz commented Jul 22, 2024

Copy link
Copy Markdown
Member Author

Ok. Perhaps reverting it here

Actually, by invalidating the environment, you somewhat fix the bugs in #12087. I prefer erring on the safe side at the cost of a single rebuild (also, it's kind of a major change where now we issue errors instead).

Also, we are just storing less information so technically I would say we should still create a new environment (from a typing PoV, it's no more possible to have a None name, now it should always be a string).

@AA-Turner AA-Turner changed the title Remove support for Sphinx 0.x intersphinx format Remove support for the Sphinx 0.5 intersphinx_mapping format Jul 22, 2024
Comment thread sphinx/ext/intersphinx/_load.py Resolved
@AA-Turner

Copy link
Copy Markdown
Member

@picnixz do you have any other changes, or is this ready to merge from your perspective?

A

@picnixz

picnixz commented Jul 22, 2024

Copy link
Copy Markdown
Member Author

do you have any other changes, or is this ready to merge from your perspective?

I don't have anything else! I expect people to be surprised if they build very old projects but I think the test coverage is sufficient. I'm just unsure whether the typing definitions I put should be kept in shared or not but this is something we can decide later (for now, let's keep them like that because the other PR is based on this one and I don't want to again solve conflicts). By the way, thank you for the CHANGES entry.

@AA-Turner
AA-Turner merged commit aacca30 into sphinx-doc:master Jul 22, 2024
@AA-Turner

Copy link
Copy Markdown
Member

Thanks all!

A

@EwoutH

EwoutH commented Aug 12, 2024

Copy link
Copy Markdown

Hi!

I just stumbled onto this PR as the root cause of our docs breaking. While I looked back and there was a deprecation warning cast by Sphinx 7.0 (which is nice, thanks!), the error message in 8.0 could be a bit clearer, pointing directly to some docs or migration guide on how to update it.

ERROR: Invalid value `None` in intersphinx_mapping['http://docs.python.org/']. Expected a two-element tuple or list.

For anyone also stumbling on this PR, the our fix was replacing:

intersphinx_mapping = {"http://docs.python.org/": None}

with

intersphinx_mapping = {'python': ('https://docs.python.org/3', None)}

As following these docs.

I was a bit amazed to see a 10 year old line of code breaking our docs configuration. Doesn't happen often!

@AA-Turner

Copy link
Copy Markdown
Member

Thanks @EwoutH. Do you have any concrete suggestions for the error message? I'm happy to update it.

A

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Sep 14, 2024
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.

4 participants