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.
To address that, this change adds the minimal pyproject.toml
to enable pbr to be properly used to build editable wheels.

This is required to support installing devstack on
centos stream 9 and related distros with GLOBAL_VENV=True
Without this change the wsgi scripts are not generated in
editable mode. i.e. pip install -e /opt/stack/keystone

See https://pip.pypa.io/en/stable/news/#v23-1
and https://github.com/pypa/pip/issues/8368 for more
details on the removal of the fallback support.

setuptools v64.0.0 is used to support editable installs
via its PEP-660 implmentation
https://github.com/pypa/setuptools/pull/3488

This patch was taken nearly verbatim from the equivalent nova change.

Co-Authored-By: Sean Mooney <work@seanmooney.info>
Change-Id: I34888e8f87b4a3ab09546ba58ef5f2cf495bc7e3
This commit is contained in:
Jay Faulkner 2024-08-29 13:49:59 -07:00 committed by Doug Goldstein
parent 6f4e679c4c
commit 6008d31f2f
No known key found for this signature in database
3 changed files with 5 additions and 2 deletions

3
pyproject.toml Normal file
View File

@ -0,0 +1,3 @@
[build-system]
requires = ["pbr>=6.0.0", "setuptools>=64.0.0"]
build-backend = "pbr.build"

View File

@ -2,7 +2,7 @@
# date but we do not test them so no guarantee of having them all correct. If # date but we do not test them so no guarantee of having them all correct. If
# you find any incorrect lower bounds, let us know or propose a fix. # you find any incorrect lower bounds, let us know or propose a fix.
pbr>=3.1.1 # Apache-2.0 pbr>=6.0.0 # Apache-2.0
SQLAlchemy>=1.4.0 # MIT SQLAlchemy>=1.4.0 # MIT
alembic>=1.4.2 # MIT alembic>=1.4.2 # MIT
automaton>=1.9.0 # Apache-2.0 automaton>=1.9.0 # Apache-2.0

View File

@ -16,6 +16,6 @@
import setuptools import setuptools
setuptools.setup( setuptools.setup(
setup_requires=['pbr>=2.0.0'], setup_requires=['pbr>=6.0.0'],
pbr=True, pbr=True,
) )