From 6f78d7d1d54f23fe3f4466a27c115e588bbaacce Mon Sep 17 00:00:00 2001 From: Sean Mooney Date: Thu, 2 Nov 2023 11:16:49 +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. 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 addtionally horizon was using a legacy packaging hook which is removed by this commit. Change-Id: I904376f05c2ceca8db9dc989909cb05ea65b79f3 --- openstack_dashboard/hooks.py | 26 -------------------------- pyproject.toml | 3 +++ setup.cfg | 4 ---- 3 files changed, 3 insertions(+), 30 deletions(-) delete mode 100644 openstack_dashboard/hooks.py create mode 100644 pyproject.toml diff --git a/openstack_dashboard/hooks.py b/openstack_dashboard/hooks.py deleted file mode 100644 index a4b39e40e5..0000000000 --- a/openstack_dashboard/hooks.py +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright 2013 Hewlett-Packard Development Company, L.P. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -# pylint: disable=no-name-in-module,import-error,deprecated-module -from distutils.command import install - - -def setup_hook(config): - """Filter config parsed from a setup.cfg to inject our defaults.""" - # Tell distutils not to put the data_files in platform-specific - # installation locations. See here for an explanation: - # https://groups.google.com/forum/#!topic/comp.lang.python/Nex7L-026uw - for scheme in install.INSTALL_SCHEMES.values(): - scheme['data'] = scheme['purelib'] 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/setup.cfg b/setup.cfg index fb3910c968..88734bb8bf 100644 --- a/setup.cfg +++ b/setup.cfg @@ -25,10 +25,6 @@ classifier = Programming Language :: Python :: 3.11 Topic :: Internet :: WWW/HTTP -[global] -setup-hooks = - openstack_dashboard.hooks.setup_hook - [files] packages = horizon