Change the test source location

Change the test source location to support evolving downstream testing
requirements. This is needed both for downstream certification
activities and changes to test development for internal infrastructure
differences.
This commit is contained in:
Lukáš Zachar 2024-12-02 09:37:39 +01:00
parent 5c0cb835f5
commit fcc549b3b3
6 changed files with 128 additions and 4 deletions

View File

@ -0,0 +1,44 @@
From 06f390d522afb6d2d71bb601c2060a9fabe3f7de Mon Sep 17 00:00:00 2001
From: Adam Williamson <awilliam@redhat.com>
Date: Mon, 19 Jul 2021 15:41:23 -0700
Subject: [PATCH] Fix disabling of location header autocorrect for werkzeug 2+
(#647)
In werkzeug 2.0.0 and later, the Location header autocorrection
moved from BaseResponse to Response, so we need to set
`autocorrect_location_header = False` in `Response` not
`BaseResponse`. From 2.1.0, BaseResponse is removed and importing
it is an error, so we can't support both any more.
Signed-off-by: Adam Williamson <awilliam@redhat.com>
---
httpbin/core.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/httpbin/core.py b/httpbin/core.py
index 66a2ed6..fd2842c 100644
--- a/httpbin/core.py
+++ b/httpbin/core.py
@@ -19,7 +19,7 @@ from flask import Flask, Response, request, render_template, redirect, jsonify a
from six.moves import range as xrange
from werkzeug.datastructures import WWWAuthenticate, MultiDict
from werkzeug.http import http_date
-from werkzeug.wrappers import BaseResponse
+from werkzeug.wrappers import Response as WzResponse
from werkzeug.http import parse_authorization_header
from raven.contrib.flask import Sentry
@@ -48,7 +48,9 @@ def jsonify(*args, **kwargs):
return response
# Prevent WSGI from correcting the casing of the Location header
-BaseResponse.autocorrect_location_header = False
+# and forcing it to be absolute.
+WzResponse.autocorrect_location_header = False
+
# Find the correct template folder when running from a different location
tmpl_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'templates')
--
2.36.0

View File

@ -0,0 +1,46 @@
From a03fa24ad65286ad9f2dc8bf1934bc84525ed06f Mon Sep 17 00:00:00 2001
From: Charalampos Stratakis <cstratak@redhat.com>
Date: Wed, 8 Mar 2023 02:48:31 +0100
Subject: [PATCH] Remove optional or unpackaged test deps
---
setup.cfg | 16 ----------------
1 file changed, 16 deletions(-)
diff --git a/setup.cfg b/setup.cfg
index 4791ed6..2776b31 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -39,20 +39,6 @@ exclude =
[options.extras_require]
testing =
pytest >= 6
- pytest-checkdocs >= 2.4
- pytest-flake8; \
- python_version < "3.12"
- flake8 < 5
- pytest-black >= 0.3.7; \
- python_implementation != "PyPy"
- pytest-cov; \
- python_implementation != "PyPy"
- pytest-mypy >= 0.9.1; \
- python_implementation != "PyPy"
- pytest-enabler >= 1.3
- pytest-perf
-
- flake8-2020
virtualenv>=13.0.0
wheel
pip>=19.1 # For proper file:// URLs support.
@@ -60,8 +46,6 @@ testing =
pytest-xdist
jaraco.path>=3.2.0
build[virtualenv]
- filelock>=3.4.0
- pip_run>=8.8
ini2toml[lite]>=0.9
tomli-w>=1.0.0
pytest-timeout
--
2.39.2

View File

@ -12,7 +12,7 @@ BuildRequires: pyproject-rpm-macros
%if 0%{?fedora} >= 37 || 0%{?rhel} >= 10
# Wekrzeug in Fedora 37 isn't compatible with our httpbin
Patch: https://src.fedoraproject.org/rpms/python-httpbin/raw/0e4a7e2812/f/0001-Fix-disabling-of-location-header-autocorrect-for-wer.patch
Patch: 0001-Fix-disabling-of-location-header-autocorrect-for-wer.patch
%endif
# no flask, itsdangerous, raven, werkzeug packaged for EPEL 9 yet

View File

@ -0,0 +1,34 @@
From 536a7671151e3070481736e5d6159987df920d8b Mon Sep 17 00:00:00 2001
From: Simon Pichugin <spichugi@redhat.com>
Date: Wed, 9 Feb 2022 16:06:14 -0800
Subject: [PATCH] Always use 'ldap' library
---
setup.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/setup.py b/setup.py
index 119b571..851223e 100644
--- a/setup.py
+++ b/setup.py
@@ -37,6 +37,8 @@ if cfg.has_section('_ldap'):
for name in dir(LDAP_CLASS):
if cfg.has_option('_ldap', name):
setattr(LDAP_CLASS, name, cfg.get('_ldap', name).split())
+#-- Overwrite it as 'ldap' is the always correct library we have in Fedora 34+
+LDAP_CLASS.libs = ['ldap', 'lber']
for i in range(len(LDAP_CLASS.defines)):
LDAP_CLASS.defines[i]=((LDAP_CLASS.defines[i],None))
@@ -132,7 +134,7 @@ setup(
extra_objects = LDAP_CLASS.extra_objects,
runtime_library_dirs = (not sys.platform.startswith("win"))*LDAP_CLASS.library_dirs,
define_macros = LDAP_CLASS.defines + \
- ('ldap_r' in LDAP_CLASS.libs or 'oldap_r' in LDAP_CLASS.libs)*[('HAVE_LIBLDAP_R',None)] + \
+ ('ldap' in LDAP_CLASS.libs or 'oldap' in LDAP_CLASS.libs)*[('HAVE_LIBLDAP_R',None)] + \
('sasl' in LDAP_CLASS.libs or 'sasl2' in LDAP_CLASS.libs or 'libsasl' in LDAP_CLASS.libs)*[('HAVE_SASL',None)] + \
('ssl' in LDAP_CLASS.libs and 'crypto' in LDAP_CLASS.libs)*[('HAVE_TLS',None)] + \
[
--
2.31.1

View File

@ -8,7 +8,7 @@ Source0: %{pypi_source}
# OpenLDAP 2.5+ is not yet supported by python-ldap
# https://github.com/python-ldap/python-ldap/issues/432
# Fedora has this patch to make it build, but the tests will fail anyway
Patch0: https://src.fedoraproject.org/rpms/python-ldap/raw/a237d9b212bd1581e07f4f1a8f54c26a7190843c/f/python-ldap-always-use-ldap-library.patch
Patch0: python-ldap-always-use-ldap-library.patch
BuildRequires: python3-devel
BuildRequires: pyproject-rpm-macros

View File

@ -15,9 +15,9 @@ Source: %{pypi_source setuptools %{version}}
# Patch from Fedora proper
%if 0%{?fedora} || 0%{?rhel} >= 10
Patch: https://src.fedoraproject.org/rpms/python-setuptools/raw/8ae9b2a777c/f/Remove-optional-or-unpackaged-test-deps.patch
Patch: Remove-optional-or-unpackaged-test-deps.patch
%else
Patch: https://src.fedoraproject.org/rpms/python-setuptools/raw/6fc093d6b3d/f/0001-Remove-optional-or-unpackaged-test-deps.patch
Patch: 0001-Remove-optional-or-unpackaged-test-deps.patch
%endif
BuildArch: noarch