From d10a6d2270f22f60b6edd937cf5dda11be6f4683 Mon Sep 17 00:00:00 2001 From: Ivan Anfimov Date: Sun, 4 May 2025 15:12:22 +0000 Subject: [PATCH] Add pyproject.toml to support pip 23.1 pip 23.1 removed the "setup.py install" fallback for projects that do not have pyproject.toml and now uses a pyproject.toml which is vendored in pip [1][2]. pip 24.2 has now deprecated a similar fallback to "setup.py develop" and plans to fully remove this in pip 25.0 [3][4][5]. pbr supports editable installs since 6.0.0 so we can get ahead of this by adding our own minimal pyproject.toml to ensure we are using the correct build system. [1] https://pip.pypa.io/en/stable/news/#v23-1 [2] https://github.com/pypa/pip/issues/8368 [3] https://pip.pypa.io/en/stable/news/#v24-2 [4] https://github.com/pypa/pip/issues/11457 [5] https://ichard26.github.io/blog/2024/08/whats-new-in-pip-24.2/ Change-Id: I66b075b15a83e8d30803e92c36683aff569f3d7b (cherry picked from commit 3e0b163d800afcb4d020dbf0c5f68886fa69bc23) --- pyproject.toml | 3 +++ requirements.txt | 2 +- setup.py | 4 +--- 3 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 pyproject.toml diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000000..5e862a9593 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["pbr>=6.0.0", "setuptools>=64.0.0"] +build-backend = "pbr.build" diff --git a/requirements.txt b/requirements.txt index 4a39a3cc2b..93edec6d5b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,7 +3,7 @@ # you find any incorrect lower bounds, let us know or propose a fix. alembic>=1.8.0 -pbr!=2.1.0,>=2.0.0 # Apache-2.0 +pbr>=6.0.0 # Apache-2.0 eventlet>=0.27.0 # MIT SQLAlchemy>=1.4.0 # MIT keystonemiddleware>=4.17.0 # Apache-2.0 diff --git a/setup.py b/setup.py index cd35c3c35b..0be93a5f6e 100644 --- a/setup.py +++ b/setup.py @@ -15,6 +15,4 @@ import setuptools -setuptools.setup( - setup_requires=['pbr>=2.0.0'], - pbr=True) +setuptools.setup(pbr=True)