From c354c288aee43ef78929420b9051cbaca88735bc Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Wed, 31 Jul 2024 14:26:05 -0400 Subject: [PATCH 1/2] Homebrew-and-Python: more PEP 668 guidance Signed-off-by: William Woodruff --- docs/Homebrew-and-Python.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/Homebrew-and-Python.md b/docs/Homebrew-and-Python.md index 6a06fcc28bdeb..4527464a6194c 100644 --- a/docs/Homebrew-and-Python.md +++ b/docs/Homebrew-and-Python.md @@ -29,7 +29,9 @@ $(brew --prefix python)/libexec/bin The Python formulae install [pip](https://pip.pypa.io/) (as `pip3`). Python@3.11 and older Python formulae also install [Setuptools](https://pypi.org/project/setuptools/). -Starting with Python@3.12, the bundled Python packages should be updated by reinstalling brewed Python. For older Python formulae, they can be updated as described below. +Starting with Python 3.12, the bundled Python packages should be updated by reinstalling brewed Python. For older Python formulae, they can be updated as described below. + +**Warning!** The steps below **do not work** for Homebrew's Python 3.12 or newer. If you need a newer version of `pip` or `setuptools` than comes with the Homebrewed Python, you **must** use a virtual environment or other isolation mechanism [per below](#pep-668-python312-and-virtual-environments). Setuptools can be updated via `pip`, without having to reinstall brewed Python: @@ -84,9 +86,9 @@ Since the system Python may not know which compiler flags to set when building b CFLAGS="-I$(brew --prefix)/include" LDFLAGS="-L$(brew --prefix)/lib" pip install ``` -## PEP 668 (Python@3.12) and virtual environments +## PEP 668 (Python 3.12) and virtual environments -Starting with Python@3.12, Homebrew follows [PEP 668](https://peps.python.org/pep-0668/#marking-an-interpreter-as-using-an-external-package-manager). +Starting with Python 3.12, Homebrew follows [PEP 668](https://peps.python.org/pep-0668/#marking-an-interpreter-as-using-an-external-package-manager). If you wish to install a non-brew-packaged Python package (from PyPI for example): From 52fd495a5c6d7bd96e28b5ed0164ddc19905a151 Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Thu, 1 Aug 2024 10:10:32 -0400 Subject: [PATCH 2/2] fix header + anchor Technically PEP 668 isn't unique to 3.12 anyways. Signed-off-by: William Woodruff --- docs/Homebrew-and-Python.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/Homebrew-and-Python.md b/docs/Homebrew-and-Python.md index 4527464a6194c..e3d90d025a45c 100644 --- a/docs/Homebrew-and-Python.md +++ b/docs/Homebrew-and-Python.md @@ -31,7 +31,7 @@ The Python formulae install [pip](https://pip.pypa.io/) (as `pip3`). Python@3.11 Starting with Python 3.12, the bundled Python packages should be updated by reinstalling brewed Python. For older Python formulae, they can be updated as described below. -**Warning!** The steps below **do not work** for Homebrew's Python 3.12 or newer. If you need a newer version of `pip` or `setuptools` than comes with the Homebrewed Python, you **must** use a virtual environment or other isolation mechanism [per below](#pep-668-python312-and-virtual-environments). +**Warning!** The steps below **do not work** for Homebrew's Python 3.12 or newer. If you need a newer version of `pip` or `setuptools` than comes with the Homebrewed Python, you **must** use a virtual environment or other isolation mechanism [per below](#pep-668-and-virtual-environments). Setuptools can be updated via `pip`, without having to reinstall brewed Python: @@ -86,7 +86,7 @@ Since the system Python may not know which compiler flags to set when building b CFLAGS="-I$(brew --prefix)/include" LDFLAGS="-L$(brew --prefix)/lib" pip install ``` -## PEP 668 (Python 3.12) and virtual environments +## PEP 668 and virtual environments Starting with Python 3.12, Homebrew follows [PEP 668](https://peps.python.org/pep-0668/#marking-an-interpreter-as-using-an-external-package-manager).