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

Remove support for the Sphinx 0.5 intersphinx_mapping format #12083

Merged
merged 19 commits into from
Jul 22, 2024

Conversation

picnixz
Copy link
Member

@picnixz picnixz commented Mar 14, 2024

Extracted from #11706.

cc @jayaddison

sphinx/ext/intersphinx.py Outdated Show resolved Hide resolved
sphinx/ext/intersphinx.py Outdated Show resolved Hide resolved
sphinx/ext/intersphinx.py Outdated Show resolved Hide resolved
sphinx/ext/intersphinx.py Outdated Show resolved Hide 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
Member

Have rebased this on the now-split intersphinx package.

A

@picnixz picnixz mentioned this pull request Jul 20, 2024
Copy link
Member

@AA-Turner AA-Turner left a comment

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

sphinx/ext/intersphinx/_load.py Outdated Show resolved Hide 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
sphinx/ext/intersphinx/_load.py Outdated Show resolved Hide resolved
sphinx/ext/intersphinx/_load.py Outdated Show resolved Hide resolved
sphinx/ext/intersphinx/_load.py Show resolved Hide resolved
@jayaddison
Copy link
Contributor

Do we need to update ENV_VERSION with this change?

@picnixz
Copy link
Member Author

picnixz commented Jul 22, 2024

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
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
Copy link
Member Author

picnixz commented Jul 22, 2024

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
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
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
Copy link
Member Author

picnixz commented Jul 22, 2024

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
@AA-Turner
Copy link
Member

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

A

@picnixz
Copy link
Member Author

picnixz commented Jul 22, 2024

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
22 checks passed
@AA-Turner
Copy link
Member

Thanks all!

A

@EwoutH
Copy link

EwoutH commented Aug 12, 2024

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
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