Add pyproject.toml and wsgi module paths

This copies a fix from the Watcher project to support pip 23.1:

https://review.opendev.org/c/openstack/watcher/+/948438

Closes-Bug: #2109584

Change-Id: I91cd5e262513b5427377ce1892e9acfe29e22b21
This commit is contained in:
melanie witt 2025-05-06 16:25:31 -07:00
parent 9f1f1c66a8
commit d98891faee
6 changed files with 28 additions and 3 deletions

View File

23
barbican/wsgi/api.py Normal file
View File

@ -0,0 +1,23 @@
# 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.
"""WSGI application entry-point for Barbican API."""
import threading
from barbican.api import app
application = None
with threading.Lock():
if application is None:
application = app.get_api_wsgi_script()

View File

@ -172,7 +172,7 @@ function configure_barbican {
# SimpleCryptoPlugin settings
iniset $BARBICAN_CONF simple_crypto_plugin kek "$(python3 -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode('UTF-8'))")"
write_uwsgi_config "$BARBICAN_UWSGI_CONF" "$BARBICAN_WSGI" "/key-manager"
write_uwsgi_config "$BARBICAN_UWSGI_CONF" "$BARBICAN_WSGI" "/key-manager" "" "barbican-api"
## Set up keystone
# Turn on the middleware

View File

@ -22,7 +22,7 @@ else
BARBICAN_BIN_DIR=$(get_python_exec_prefix)
fi
# WSGI variables
BARBICAN_WSGI=$BARBICAN_BIN_DIR/barbican-wsgi-api
BARBICAN_WSGI=barbican.wsgi.api:application
BARBICAN_UWSGI_CONF=$BARBICAN_CONF_DIR/barbican-uwsgi.ini
# Set Barbican repository

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

@ -18,7 +18,6 @@ classifier =
Programming Language :: Python :: Implementation :: CPython
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12