python311Packages.flask-gravatar: fix flask 3.0 compat

This commit is contained in:
Martin Weinelt 2024-01-26 02:04:22 +01:00
parent 53137014db
commit 8592e8e554
No known key found for this signature in database
GPG key ID: 87C1E9888F856759

View file

@ -1,7 +1,15 @@
{ lib
, buildPythonPackage
, fetchPypi
, fetchpatch
# build-system
, setuptools
# dependencies
, flask
# tests
, pytestCheckHook
, pygments
}:
@ -17,6 +25,14 @@ buildPythonPackage rec {
sha256 = "YGZfMcLGEokdto/4Aek+06CIHGyOw0arxk0qmSP1YuE=";
};
patches = [
(fetchpatch {
# flask 3.0 compat
url = "https://github.com/zzzsochi/Flask-Gravatar/commit/d74d70d9695c464b602c96c2383d391b38ed51ac.patch";
hash = "sha256-tCKkA2io/jhvrh6RhTeEw4AKnIZc9hsqTf2qItUsdjo=";
})
];
postPatch = ''
sed -i setup.py \
-e "s|tests_require=tests_require,||g" \
@ -28,6 +44,10 @@ buildPythonPackage rec {
--replace "--cov=flask_gravatar --cov-report=term-missing" ""
'';
nativeBuildInputs = [
setuptools
];
propagatedBuildInputs = [
flask
];
@ -37,7 +57,9 @@ buildPythonPackage rec {
pygments
];
pythonImportsCheck = [ "flask_gravatar" ];
pythonImportsCheck = [
"flask_gravatar"
];
meta = with lib; {
homepage = "https://github.com/zzzsochi/Flask-Gravatar";