mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-09-16 14:29:05 -07:00
dev-python/httpbin: Remove old
Signed-off-by: Michał Górny <mgorny@gentoo.org>
This commit is contained in:
@@ -1,3 +1,2 @@
|
||||
DIST httpbin-0.10.2.tar.gz 107327 BLAKE2B 39ab1e518c9f7e1ede9cd0aa2e3155f7e36267c83d1d2537a5b6cb5aa1c9e70efe96c5bf98a5b22cd05e70368d1495f8e5364032fcf2f476d62512b7e7322652 SHA512 731b842090be516d9eccb1d2bb8303128d2b2e24b1ebf0b2018a2f0b8629b164c7de686e1775841cd57417ec89941d98fc81f878a284c7242bfef4db481a781b
|
||||
DIST httpbin-0.10.4.tar.gz 109267 BLAKE2B e01b8b3cb9b91519a517bbb82ea226b94f8c7a18933a0412e2b0e3a4432a9c8d012d5c92a1b031621507195b79c7f330ea24fe5223ca476bcf2659630c3f9cf3 SHA512 dab715d21a134bf3b3d4d929c5685041195d383a91ee2dae2bbe13dcc9fbe5f4d60dc8131438547a48606997437ea7f5e77e0ed3d3d34e358fea88283de54a37
|
||||
DIST httpbin-0.10.4.tar.gz.provenance 9636 BLAKE2B 71c8bbc97cb1e36936c1618fe1cc12980650fcd751507c9c98a0e96a03dcfea11bdb414e5e81ece9d7feef8496d149969194ae2394cb3d72eefdeab84e38dfd9 SHA512 f022aa65725e0a156d0c46adbd2f689bcab62a646cad576482e78b76444c56a945af0ae12aad9994321d6b331b12a4bf94eff3270032e5c3ba1a997316b98bf4
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
From 65e397d7332ab87e3b2455ff9dc99af24861b58b Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
|
||||
Date: Sat, 3 Feb 2024 11:20:00 +0100
|
||||
Subject: [PATCH] Support using httpbin without flasgger
|
||||
|
||||
Make the dependency on flasgger optional. The dependency has been added
|
||||
relatively recently (i.e. before the original package was abandoned but
|
||||
after its last release), and it is only used to provide a more dynamic
|
||||
landing page. This is unnecessary for use of httpbin for testing,
|
||||
and it introduces an indirect dependency on Rust that is problematic.
|
||||
|
||||
With this change, flasgger is no longer installed by default. It can be
|
||||
enabled via "[flasgger]" extra. When flasgger is not available, httpbin
|
||||
redirects to the "legacy" index page.
|
||||
---
|
||||
httpbin/core.py | 17 +++++++++++++++--
|
||||
pyproject.toml | 4 +++-
|
||||
tests/test_httpbin.py | 4 +++-
|
||||
3 files changed, 21 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/httpbin/core.py b/httpbin/core.py
|
||||
index a82c1b8..77576a4 100644
|
||||
--- a/httpbin/core.py
|
||||
+++ b/httpbin/core.py
|
||||
@@ -33,7 +33,10 @@ try:
|
||||
except ImportError: # werkzeug < 2.1
|
||||
from werkzeug.wrappers import BaseResponse as Response
|
||||
|
||||
-from flasgger import Swagger, NO_SANITIZER
|
||||
+try:
|
||||
+ from flasgger import Swagger, NO_SANITIZER
|
||||
+except ImportError:
|
||||
+ Swagger = None
|
||||
|
||||
from . import filters
|
||||
from .helpers import (
|
||||
@@ -165,7 +168,8 @@ swagger_config = {
|
||||
"specs_route": "/",
|
||||
}
|
||||
|
||||
-swagger = Swagger(app, sanitizer=NO_SANITIZER, template=template, config=swagger_config)
|
||||
+if Swagger is not None:
|
||||
+ swagger = Swagger(app, sanitizer=NO_SANITIZER, template=template, config=swagger_config)
|
||||
|
||||
# Set up Bugsnag exception tracking, if desired. To use Bugsnag, install the
|
||||
# Bugsnag Python client with the command "pip install bugsnag", and set the
|
||||
@@ -244,6 +250,13 @@ def set_cors_headers(response):
|
||||
# ------
|
||||
|
||||
|
||||
+if Swagger is None:
|
||||
+ @app.route("/")
|
||||
+ def no_flasgger_index():
|
||||
+ """Redirect to legacy index if flasgger is not available."""
|
||||
+ return view_landing_page()
|
||||
+
|
||||
+
|
||||
@app.route("/legacy")
|
||||
def view_landing_page():
|
||||
"""Generates Landing Page in legacy layout."""
|
||||
--
|
||||
2.43.0
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
# Copyright 1999-2025 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
DISTUTILS_USE_PEP517=setuptools
|
||||
PYTHON_COMPAT=( python3_{11..14} pypy3_11 )
|
||||
|
||||
inherit distutils-r1 optfeature pypi
|
||||
|
||||
DESCRIPTION="HTTP Request and Response Service"
|
||||
HOMEPAGE="
|
||||
https://github.com/psf/httpbin/
|
||||
https://pypi.org/project/httpbin/
|
||||
"
|
||||
|
||||
LICENSE="|| ( MIT ISC )"
|
||||
SLOT="0"
|
||||
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~mips ppc ppc64 ~riscv ~s390 ~sparc x86"
|
||||
IUSE="test-rust"
|
||||
|
||||
RDEPEND="
|
||||
dev-python/brotlicffi[${PYTHON_USEDEP}]
|
||||
dev-python/decorator[${PYTHON_USEDEP}]
|
||||
>=dev-python/flask-2.2.4[${PYTHON_USEDEP}]
|
||||
dev-python/itsdangerous[${PYTHON_USEDEP}]
|
||||
dev-python/markupsafe[${PYTHON_USEDEP}]
|
||||
dev-python/six[${PYTHON_USEDEP}]
|
||||
>=dev-python/werkzeug-2.2.2[${PYTHON_USEDEP}]
|
||||
"
|
||||
BDEPEND="
|
||||
test? (
|
||||
test-rust? (
|
||||
dev-python/flasgger[${PYTHON_USEDEP}]
|
||||
)
|
||||
)
|
||||
"
|
||||
|
||||
distutils_enable_tests pytest
|
||||
|
||||
src_prepare() {
|
||||
local PATCHES=(
|
||||
# https://github.com/psf/httpbin/pull/44 (simplified)
|
||||
"${FILESDIR}/httpbin-0.10.1-optional-flasgger.patch"
|
||||
)
|
||||
|
||||
# remove unnecessary deps
|
||||
sed -i -e '/greenlet/d' -e '/flasgger/d' pyproject.toml || die
|
||||
distutils-r1_src_prepare
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
optfeature "Fancy index" dev-python/flasgger
|
||||
}
|
||||
Reference in New Issue
Block a user