-
-
Notifications
You must be signed in to change notification settings - Fork 32k
gh-122661: Remove GNU make-specific directive from Doc/Makefile #122662
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
Conversation
`define` - https://www.gnu.org/software/make/manual/html_node/Multi_002dLine.html - is a GNU make extension not generally supported by other makes. Introduce `UV` variable to accomodate for the case when `uv` is not in `PATH`. Remove the ```bash $ python -m $(1) --version >/dev/null ``` commands that can prevent the installation of a package when it's already present. The rationale is this approach is really fragile, for multiple reasons. Firstly, it works on packages defining `__main__.py` module, there- fore as an example, `anyio==4.4.0` package, even if installed, would output: ```bash $ /tmp/venv/bin/python -m anyio >/dev/null /tmp/venv/bin/python: No module named anyio.__main__; 'anyio' is a package and cannot be directly executed $ echo $? 1 ``` Secondly, unlike package installation, which is insensitive to capitalization as well as `-`/`_` separators - https://packaging.python.org/en/latest/specifications/name-normalization/#names-and-normalization - module names are sensitive to naming, meaning this may happen (and indeed happened in bc37ac7) ```bash $ /tmp/venv/bin/python -m sphinx-autobuild --help >/dev/null /tmp/venv/bin/python: No module named sphinx-autobuild $ echo $? 1 $ /tmp/venv/bin/python -m sphinx_autobuild --help >/dev/null $ echo $? 0 ``` And lastly, name of the package may not be the same as its contents that are subsequently imported. Consider `PyYAML==6.0.1`, whose contents are importable from the `yaml` namespace - https://pyyaml.org/wiki/PyYAMLDocumentation ```bash $ /tmp/venv/bin/python -m pyyaml >/dev/null /tmp/venv/bin/python: No module named pyyaml $ /tmp/venv/bin/python -m yaml >/dev/null /tmp/venv/bin/python: No module named yaml.__main__; 'yaml' is a package and cannot be directly executed ```
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
@@ -150,14 +151,10 @@ gettext: build | |||
htmlview: html | |||
$(PYTHON) -c "import os, webbrowser; webbrowser.open('file://' + os.path.realpath('build/html/index.html'))" | |||
|
|||
.PHONY: ensure-sphinx-autobuild | |||
ensure-sphinx-autobuild: venv | |||
$(call ensure_package,sphinx-autobuild) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As alluded in the PR description, this code contains a bug, because the python -m sphinx-autobuild
always fails:
$ /tmp/venv/bin/python -m sphinx-autobuild --help >/dev/null
/tmp/venv/bin/python: No module named sphinx-autobuild
$ echo $?
1
$ /tmp/venv/bin/python -m sphinx_autobuild --help >/dev/null
$ echo $?
0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to let you know, there have been discussions about requiring GNU make, but no decisions have been made yet:
https://discuss.python.org/t/make-compatibility-requirements/26869
Anyway, these changes are fine and thanks for the fixes!
…pythonGH-122662) (cherry picked from commit f5c39b3) Co-authored-by: Libor Martínek <[email protected]>
…pythonGH-122662) (cherry picked from commit f5c39b3) Co-authored-by: Libor Martínek <[email protected]>
GH-122668 is a backport of this pull request to the 3.13 branch. |
GH-122669 is a backport of this pull request to the 3.12 branch. |
GH-122662) (#122669) Co-authored-by: Libor Martínek <[email protected]>
Thank you for the pointer to the forum thread. As I pointed out in the
instead of
which would be IMO nicer, since you can see the prerequisite of Personally, I do not have a horse in this race, be it GNU make or BSD make, but it would be nice to reach an explicit resolution which one is actually necessary to build stuff correctly. Running the targets on FreeBSD with One last thing - I wanted to ask about commit messages. In my original commit, I wrote a really detailed message what changes (and why) are introduced - 06b20b5 . However, on Why can't the commit messages be included as well? This forces CPython to rely on out-of-band information, namely a git provider, which may or may not be present in years to come... Thank you for your time and answers! (If anyone is more knowledgeable about the commit messages being off-loaded, please, tag them here, I find commit messages a treasure trove of information and oftentimes joy to read 😉 ) |
I think the commit message body was cleared by the Refined GitHub browser extension I have installed. If there are many commits, the default would be to list all the commit titles only, which is less useful. I can see it can be less useful when there's a single commit with a detailed body. |
It needs to be done manually, I'll do it. Thanks for the reminder! |
GH-122662) (#122668) Co-authored-by: Libor Martínek <[email protected]>
Description
define
- https://www.gnu.org/software/make/manual/html_node/Multi_002dLine.html - is a GNU make extension not generally supported by other makes.Changes
Introduce
UV
variable to accomodate for the case whenuv
is not inPATH
.Remove the
commands that can prevent the installation of a package when it's already present.
The rationale is this approach is really fragile, for multiple reasons.
Firstly, it works on packages defining
__main__.py
module, there- fore as an example,anyio==4.4.0
package, even if installed, would output:Secondly, unlike package installation, which is insensitive to capitalization as well as
-
/_
separators - https://packaging.python.org/en/latest/specifications/name-normalization/#names-and-normalization - module names are sensitive to naming, meaning this may happen (and indeed happened in bc37ac7)And lastly, name of the package may not be the same as its contents that are subsequently imported. Consider
PyYAML==6.0.1
, whose contents are importable from theyaml
namespace - https://pyyaml.org/wiki/PyYAMLDocumentationFurther work
The whole
Makefile
does not work properly when not usingGNU make
. Consider the following target:the way
BUILDER
variable is set, in a prerequisite, does not work in other makes - variable is empty when defined this way. This will probably need another issue and pull request.make distclean
needsGNU make
to work #122661📚 Documentation preview 📚: https://cpython-previews--122662.org.readthedocs.build/