Skip to content

Use replacements to update versions in "Using Python on macOS" #130400

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

hugovk
Copy link
Member

@hugovk hugovk commented Feb 21, 2025

So the versions in https://docs.python.org/3.13/using/mac.html and https://docs.python.org/3.14/using/mac.html aren't hardcoded to "3.13", and reflect the current version.


📚 Documentation preview 📚: https://cpython-previews--130400.org.readthedocs.build/

@hugovk hugovk requested a review from AA-Turner as a code owner February 21, 2025 13:04
@hugovk hugovk added the needs backport to 3.13 bugs and security fixes label Feb 21, 2025
@hugovk hugovk added skip issue skip news docs Documentation in the Doc dir labels Feb 21, 2025
Copy link
Member

@ned-deily ned-deily left a comment

Choose a reason for hiding this comment

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

Thanks for doing this. Note there are still some hardwired 3.13 path references in the Advanced Topics section; it would be nice to address those, too.

@hugovk
Copy link
Member Author

hugovk commented Feb 22, 2025

Thanks, I've replaced some more. Unfortunately the formatting isn't as good, but I think it's acceptable from a maintenance point of view, if there's no better solution?

Before After
image image

But I've not replaced the hardcoded versions in this section, I don't have a good method for that:

https://docs.python.org/dev/using/mac.html#installing-using-the-command-line

@AA-Turner
Copy link
Member

Would an alternative be to have a test/lint ensuring that the version is current? It would be a shame to accept strictly worse aesthetics for a tooling problem.

A

@hugovk
Copy link
Member Author

hugovk commented Feb 24, 2025

That could work, what sort of thing do you have in mind?

Of course, it would be great if Sphinx directly supported replacements in code blocks ;)


Oh, I've just discovered parsed literal blocks:

This gives improved formatting, although no syntax highlighting:

Before After
image image
image image

@ned-deily
Copy link
Member

ned-deily commented Feb 25, 2025

I struggled with how to handle versions in formatted code when I did the rewrite for 3.13. I'm glad I'm not the only one! If it could be done without a lot of trouble, the linting solution sounds fine until (if ever) there is a better solution with Sphinx / Docutils as this only needs to be updated once a year. But I'll leave it up to you(s).

@python-cla-bot
Copy link

python-cla-bot bot commented Apr 18, 2025

All commit authors signed the Contributor License Agreement.

CLA signed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

3 participants