From 8f2db41ae671bbf1c34a200deae9df4cbfdd8f16 Mon Sep 17 00:00:00 2001 From: Rihaan Meher Date: Mon, 26 May 2025 18:33:17 -0400 Subject: [PATCH 1/6] gh-133503 Update `compileall.rst`'s documentation of `-s` and `-p` for clarity --- Doc/library/compileall.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Doc/library/compileall.rst b/Doc/library/compileall.rst index c42288419c4d2d..28acc4759ef5c7 100644 --- a/Doc/library/compileall.rst +++ b/Doc/library/compileall.rst @@ -62,6 +62,13 @@ compile Python sources. recorded in the ``.pyc`` files. Cannot be combined with ``-d``. +.. warning:: + Removing the prefix makes paths relative to it. + +.. note:: + - ``-s`` and ``-p`` can be used simultaneously. + - ``-p /`` can be used to make the path absolute. + .. option:: -x regex regex is used to search the full path to each file considered for From 5e7aad90cec70ff2d23dffe0f382f2b94acf4d02 Mon Sep 17 00:00:00 2001 From: Rihaan Meher Date: Mon, 26 May 2025 19:34:56 -0400 Subject: [PATCH 2/6] gh-133503: Remove note attribute and document `-s` separately --- Doc/library/compileall.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Doc/library/compileall.rst b/Doc/library/compileall.rst index 28acc4759ef5c7..2643bebdca8fa6 100644 --- a/Doc/library/compileall.rst +++ b/Doc/library/compileall.rst @@ -56,18 +56,18 @@ compile Python sources. executed. .. option:: -s strip_prefix + +.. warning:: + Removing the prefix makes paths relative to it. + .. option:: -p prepend_prefix Remove (``-s``) or append (``-p``) the given prefix of paths recorded in the ``.pyc`` files. Cannot be combined with ``-d``. -.. warning:: - Removing the prefix makes paths relative to it. - -.. note:: - - ``-s`` and ``-p`` can be used simultaneously. - - ``-p /`` can be used to make the path absolute. + ``-s`` and ``-p`` can be used simultaneously. + ``-p /`` can be used to make the path absolute. .. option:: -x regex From 30de5e7f4d502f8a7ebfb542aa7a1775b3ada0dc Mon Sep 17 00:00:00 2001 From: Rihaan Meher Date: Mon, 26 May 2025 19:56:23 -0400 Subject: [PATCH 3/6] gh-133503 Do not reference `s` too much in `p` --- Doc/library/compileall.rst | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Doc/library/compileall.rst b/Doc/library/compileall.rst index 2643bebdca8fa6..617528f2e2203f 100644 --- a/Doc/library/compileall.rst +++ b/Doc/library/compileall.rst @@ -57,16 +57,15 @@ compile Python sources. .. option:: -s strip_prefix -.. warning:: Removing the prefix makes paths relative to it. + Can be used with ``p`` .. option:: -p prepend_prefix Remove (``-s``) or append (``-p``) the given prefix of paths recorded in the ``.pyc`` files. Cannot be combined with ``-d``. - - ``-s`` and ``-p`` can be used simultaneously. + Can be used with ``s`` ``-p /`` can be used to make the path absolute. .. option:: -x regex From 54422609f7c2ec6507adad65841049e080bce7e3 Mon Sep 17 00:00:00 2001 From: Rihaan Meher Date: Tue, 27 May 2025 07:53:52 -0400 Subject: [PATCH 4/6] gh-133503: Remove any and all references of `s` and `p` together --- Doc/library/compileall.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/compileall.rst b/Doc/library/compileall.rst index 617528f2e2203f..a79b94a7fe706b 100644 --- a/Doc/library/compileall.rst +++ b/Doc/library/compileall.rst @@ -58,12 +58,12 @@ compile Python sources. .. option:: -s strip_prefix Removing the prefix makes paths relative to it. + You can remove (``s``) the given prefix of paths recorded in the ``.pyc`` files. Can be used with ``p`` .. option:: -p prepend_prefix - Remove (``-s``) or append (``-p``) the given prefix of paths - recorded in the ``.pyc`` files. + You can append (``-p``) the given prefix of paths recorded in the ``.pyc`` files. Cannot be combined with ``-d``. Can be used with ``s`` ``-p /`` can be used to make the path absolute. From 6be87f808ec9e18b4e783214975b720ded7ba0f1 Mon Sep 17 00:00:00 2001 From: Rihaan Meher Date: Tue, 27 May 2025 07:55:36 -0400 Subject: [PATCH 5/6] gh-133503 Update compileall.rst again for clarity --- Doc/library/compileall.rst | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Doc/library/compileall.rst b/Doc/library/compileall.rst index a79b94a7fe706b..21730e30621b18 100644 --- a/Doc/library/compileall.rst +++ b/Doc/library/compileall.rst @@ -57,16 +57,17 @@ compile Python sources. .. option:: -s strip_prefix - Removing the prefix makes paths relative to it. - You can remove (``s``) the given prefix of paths recorded in the ``.pyc`` files. - Can be used with ``p`` + 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 - You can append (``-p``) the given prefix of paths recorded in the ``.pyc`` files. - Cannot be combined with ``-d``. - Can be used with ``s`` - ``-p /`` can be used to make the path absolute. + 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``. .. option:: -x regex From 812c25c864e4f835515ebf22c010d5b3b4b48e19 Mon Sep 17 00:00:00 2001 From: Rihaan Meher Date: Tue, 27 May 2025 12:27:27 -0400 Subject: [PATCH 6/6] gh-133503 Fix wrong words - Append to Prepend MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> --- Doc/library/compileall.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/compileall.rst b/Doc/library/compileall.rst index 21730e30621b18..ebbbf857e717a4 100644 --- a/Doc/library/compileall.rst +++ b/Doc/library/compileall.rst @@ -64,7 +64,7 @@ compile Python sources. .. option:: -p prepend_prefix - Append the given prefix to paths recorded in the ``.pyc`` files. + Prepend 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``.