Skip to content

gh-133503: Update compileall.rst's documentation of -s and -p for clarity, #134756

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

Merged
merged 6 commits into from
Jun 1, 2025

Conversation

sharktide
Copy link
Contributor

@sharktide sharktide commented May 26, 2025

This will close #133503

This PR simple updates compileall.rst to alert users to these following risks as stated by @mgorny

Removing the prefix makes paths relative to it.
-s and -p can be used simultaneously.
-p / can be used to make the path absolute.


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

Copy link
Member

@picnixz picnixz left a comment

Choose a reason for hiding this comment

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

Instead of having a common entry for -s and -p, we should have different entries as the warning (which should not be a warning IMO) is only for -s.

@bedevere-app
Copy link

bedevere-app bot commented May 26, 2025

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@sharktide
Copy link
Contributor Author

@picnixz IMO it should be a warning considering it could cause breaking changes to programs if people don't pay close attention

@sharktide
Copy link
Contributor Author

I have made the requested changes; please review again

@bedevere-app
Copy link

bedevere-app bot commented May 26, 2025

Thanks for making the requested changes!

@picnixz: please review the changes made to this pull request.

@bedevere-app bedevere-app bot requested a review from picnixz May 26, 2025 23:37
@picnixz
Copy link
Member

picnixz commented May 26, 2025

IMO it should be a warning considering it could cause breaking changes to programs if people don't pay close attention

I don't see how it's a breaking change. This has been the default behavior for ages. And warnings boxes should be used carefully as they disrupt the reading flow.

@sharktide
Copy link
Contributor Author

Ok! I am doing it. Please review in a minute

@picnixz
Copy link
Member

picnixz commented May 26, 2025

I'll review tomorrow. It's 2 AM for me

@sharktide
Copy link
Contributor Author

sharktide commented May 26, 2025

Sorry! It's only 19:52 for me

*I love 24 hr time even though I live in the US*

@sharktide
Copy link
Contributor Author

@picnixz Get some sleep and please review in your morning :)

Copy link
Contributor

@mgorny mgorny left a comment

Choose a reason for hiding this comment

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

I think the documentation is inconsistent now. Previously -s and -p were documented as a single paragraph following both options. Now -s is followed by a comment, then -p is followed by the description of both options. They should either be described separately, or both notes need to be placed below -p.

Copy link
Member

@picnixz picnixz left a comment

Choose a reason for hiding this comment

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

I would suggest the following:

.. option:: -s strip_prefix

   Remove the given prefix from paths recorded in the ``.pyc`` files.
   Paths are made relative to the prefix.

   This option can be used with ``-p`` but not with ``-d``.

.. option:: -p prepend_prefix

   Append the given prefix to paths recorded in the ``.pyc`` files.
   Use ``-p /`` to make the paths absolute.

   This option can be used with ``-s`` but not with ``-d``.

@bedevere-app
Copy link

bedevere-app bot commented May 27, 2025

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@bedevere-app
Copy link

bedevere-app bot commented May 27, 2025

Thanks for making the requested changes!

@picnixz: please review the changes made to this pull request.

@bedevere-app bedevere-app bot requested a review from picnixz May 27, 2025 11:59
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
@sharktide
Copy link
Contributor Author

@picnixz Fixed it

@sharktide
Copy link
Contributor Author

I have made the requested changes; please review again

@bedevere-app
Copy link

bedevere-app bot commented May 27, 2025

Thanks for making the requested changes!

@picnixz: please review the changes made to this pull request.

@bedevere-app bedevere-app bot requested a review from picnixz May 27, 2025 16:28
Copy link
Contributor

@mgorny mgorny left a comment

Choose a reason for hiding this comment

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

I think it's clear enough for me.

@picnixz picnixz merged commit fe6f8a3 into python:main Jun 1, 2025
27 of 28 checks passed
@github-project-automation github-project-automation bot moved this from Todo to Done in Docs PRs Jun 1, 2025
@picnixz picnixz added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes labels Jun 1, 2025
@miss-islington-app
Copy link

Thanks @sharktide for the PR, and @picnixz for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

@miss-islington-app
Copy link

Thanks @sharktide for the PR, and @picnixz for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 1, 2025
(cherry picked from commit fe6f8a3)

Co-authored-by: Rihaan Meher <meherrihaan@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
@bedevere-app
Copy link

bedevere-app bot commented Jun 1, 2025

GH-134996 is a backport of this pull request to the 3.13 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 1, 2025
(cherry picked from commit fe6f8a3)

Co-authored-by: Rihaan Meher <meherrihaan@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Jun 1, 2025
@bedevere-app
Copy link

bedevere-app bot commented Jun 1, 2025

GH-134997 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label Jun 1, 2025
picnixz added a commit that referenced this pull request Jun 1, 2025
gh-133503: clarify `compileall -s/-p` docs (GH-134756)
(cherry picked from commit fe6f8a3)

Co-authored-by: Rihaan Meher <meherrihaan@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
picnixz added a commit that referenced this pull request Jun 1, 2025
gh-133503: clarify `compileall -s/-p` docs (GH-134756)
(cherry picked from commit fe6f8a3)

Co-authored-by: Rihaan Meher <meherrihaan@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
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
Status: Done
Development

Successfully merging this pull request may close these issues.

compileall: -s surprisingly makes path relative
3 participants