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

gh-114785: Remove Porting from Python2 how-to #114805

Merged
merged 8 commits into from
Feb 12, 2024
Merged

Conversation

sobolevn
Copy link
Member

@sobolevn sobolevn commented Jan 31, 2024

I feel a pleasant warmth inside by proposing this change 😆

However, I don't insist on making it: it might still be useful for someone, even outdated.
In my opinion - it is not really helpful anymore.


📚 Documentation preview 📚: https://cpython-previews--114805.org.readthedocs.build/en/114805/howto/pyporting.html

@hugovk
Copy link
Member

hugovk commented Jan 31, 2024

This page does have some traffic.

From the Plausible 30-day trial, /3/howto/pyporting.html was number 266 out of 14,767 pages, with 3,995 views. That's a bit less than the 4,016 views for the Spanish homepage: /es/3/.

Instead of outright deleting and serving a 404 to visitors, can we avoid contributing to linkrot and put something else useful on the page?

Are there some useful external resources we can link to?

@sobolevn
Copy link
Member Author

sobolevn commented Jan 31, 2024

@hugovk great that we have these numbers! I didn't know we collect them.
I am open to suggestions about the content we can put there. Last time I used a Python2 project was like 10 years ago, so I am not an expert here.

@hugovk
Copy link
Member

hugovk commented Jan 31, 2024

This guide by Fedora looks good: https://portingguide.readthedocs.io

Here's a 2.5 hour PyCon 2020 tutorial: https://www.youtube.com/watch?v=JgIgEjASOlk

And a tutorial by Digital Ocean: https://www.digitalocean.com/community/tutorials/how-to-port-python-2-code-to-python-3

And by ActiveState: https://www.activestate.com/blog/how-to-migrate-python-2-applications-to-python-3/

We could keep these three paragraphs from the abstract (shift them out of the abstract and delete the abstract):

Python 2 reached its official end-of-life at the start of 2020. This means that no new bug reports, fixes, or changes will be made to Python 2 - it’s no longer supported.

If you are looking to port an extension module instead of pure Python code, please see Porting Extension Modules to Python 3.

The archived python-porting mailing list may contain some useful guidance.

And add links to:

And then links to those resources.

Doc/whatsnew/2.7.rst Outdated Show resolved Hide resolved
@brettcannon
Copy link
Member

Is there any reason not to think that search engines won't update to the e.g. 3.12 version of that page?

@sobolevn
Copy link
Member Author

sobolevn commented Feb 1, 2024

Is there any reason not to think that search engines won't update to the e.g. 3.12 version of that page?

Sorry, I don't understand your question :(

@hugovk
Copy link
Member

hugovk commented Feb 1, 2024

I think the question is:

If we delete the page at https://docs.python.org/3/howto/pyporting.html, will search engines stop suggesting it and instead start suggesting https://docs.python.org/3.12/howto/pyporting.html?

Maybe they will? SEO is a mysterious art. We still sometimes get reports that old version pages shown up results.

We do have this in the 3.12 page which tells search engines the canonical page is the one deleted in this PR, which might confuse things:

<link rel="canonical" href="https://docs.python.org/3/howto/pyporting.html" />

Perhaps we can change that to point to /3.12/ just for this page (also in /3.11/?

In any case, even if search engines do start pointing to /3.12/, it won't fix linkrot -- it won't fix other websites that link to https://docs.python.org/3/howto/pyporting.html

To sort that, we should either keep a stub page, or figure out some redirects from https://docs.python.org/3/howto/pyporting.html to elsewhere.

I favour a stub page.

vstinner
vstinner previously approved these changes Feb 1, 2024
Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

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

LGTM.

@encukou
Copy link
Member

encukou commented Feb 1, 2024

Replacing it with a stub and link list, as @hugovk suggested (and as we did for cporting-howto), sounds good to me. That way, people who end up there have a place to go.

(Disclosure: I “maintain” Fedora's guide. Not that there's much to maintain there, with the disclaimer that it'll get you up to Python 3.6 and then you're on your own.)

Is it possible to remove it from the rendered tables of contents? That might be appropriate too.

Doc/howto/pyporting.rst Outdated Show resolved Hide resolved
Doc/howto/pyporting.rst Show resolved Hide resolved
Doc/howto/pyporting.rst Outdated Show resolved Hide resolved
Doc/howto/pyporting.rst Outdated Show resolved Hide resolved
Copy link
Member

@hugovk hugovk left a comment

Choose a reason for hiding this comment

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

Thanks, looking good!

Doc/howto/pyporting.rst Outdated Show resolved Hide resolved
Co-authored-by: Hugo van Kemenade <[email protected]>
@vstinner vstinner dismissed their stale review February 4, 2024 10:51

I remove my review since the PR changed

@sobolevn
Copy link
Member Author

Anything else left to do? Or can we proceed? :)

@hugovk
Copy link
Member

hugovk commented Feb 12, 2024

I think this is ready to merge, would you like to use your new powers and do the honours? :)

@hugovk hugovk added needs backport to 3.11 only security fixes needs backport to 3.12 bug and security fixes labels Feb 12, 2024
@sobolevn
Copy link
Member Author

Sure 🎉

@sobolevn sobolevn merged commit 705c76d into python:main Feb 12, 2024
25 checks passed
@miss-islington-app
Copy link

Thanks @sobolevn for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Feb 12, 2024
…ythonGH-114805)

Keep the page though, because people might still rely on it (the traffic shows that they do).
Instead of our own manual we now give links to the 3rd-party ones.

(cherry picked from commit 705c76d)

Co-authored-by: Nikita Sobolev <[email protected]>
Co-authored-by: Hugo van Kemenade <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Feb 12, 2024

GH-115327 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 bug and security fixes label Feb 12, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Feb 12, 2024
…ythonGH-114805)

Keep the page though, because people might still rely on it (the traffic shows that they do).
Instead of our own manual we now give links to the 3rd-party ones.

(cherry picked from commit 705c76d)

Co-authored-by: Nikita Sobolev <[email protected]>
Co-authored-by: Hugo van Kemenade <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Feb 12, 2024

GH-115328 is a backport of this pull request to the 3.11 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.11 only security fixes label Feb 12, 2024
@sobolevn
Copy link
Member Author

@hugovk I am not sure about the backports. Maybe we should keep older versions as-is?

@encukou
Copy link
Member

encukou commented Feb 12, 2024

Please don't backport a removal.
(If you do, update the version in “Since Python 3.13 the original porting guide was discontinued.”)

@hugovk
Copy link
Member

hugovk commented Feb 12, 2024

The reason for making these changes was to help people because the existing info is outdated and points to tools that don't support Python 2, and they'll struggle if they try and follow the advice.

If we don't backport to 3.12 (= /3/ default docs), people will still see the outdated, unhelpful information for another six months (until 3.13 is released).

I think it should at least be backported to 3.12.

Similarly for 3.11: we want people to have helpful information. Let's put that in front of people in as many places as possible (= bugfix branches).

(If you do, update the version in “Since Python 3.13 the original porting guide was discontinued.”)

Good point, and update the link to point to the last version with the old guide.

@sobolevn
Copy link
Member Author

I also have

`archive <https://docs.python.org/3.12/howto/pyporting.html>`_. 

link in the new docs, so I would have to update it to be 3.11 if we backport to 3.12

I see pros and cons with both ways, I will listen to others here :)

fsc-eriker pushed a commit to fsc-eriker/cpython that referenced this pull request Feb 14, 2024
…ython#114805)

Keep the page though, because people might still rely on it (the traffic shows that they do).
Instead of our own manual we now give links to the 3rd-party ones.

Co-authored-by: Hugo van Kemenade <[email protected]>
ambv pushed a commit that referenced this pull request Feb 21, 2024
…H-114805) (GH-115327)

Keep the page though, because people might still rely on it (the traffic shows that they do).
Instead of our own manual we now give links to the 3rd-party ones.

(cherry picked from commit 705c76d)

Co-authored-by: Nikita Sobolev <[email protected]>
Co-authored-by: Hugo van Kemenade <[email protected]>
ambv pushed a commit that referenced this pull request Feb 21, 2024
…H-114805) (GH-115328)

Keep the page though, because people might still rely on it (the traffic shows that they do).
Instead of our own manual we now give links to the 3rd-party ones.

(cherry picked from commit 705c76d)

Co-authored-by: Nikita Sobolev <[email protected]>
Co-authored-by: Hugo van Kemenade <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants