Skip to content

Commit

Permalink
python311Packages.flask-session-captcha: fix build with flask 3.0
Browse files Browse the repository at this point in the history
Applies a patch that fixes the markupsafe import. Tests still don't work.
  • Loading branch information
mweinelt committed Jan 26, 2024
1 parent 569fb19 commit 22e6903
Showing 1 changed file with 35 additions and 6 deletions.
41 changes: 35 additions & 6 deletions pkgs/development/python-modules/flask-session-captcha/default.nix
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
{ lib
, fetchFromGitHub
, fetchpatch
, buildPythonPackage

# build-system
, setuptools

# dependencies
, captcha
, flask
, flask-sessionstore
, markupsafe

# tests
, flask-sqlalchemy
, captcha
, pytestCheckHook
}:

buildPythonPackage rec {
pname = "flask-session-captcha";
version = "1.3.0";
format = "setuptools";
pyproject = true;

src = fetchFromGitHub {
owner = "Tethik";
Expand All @@ -20,15 +28,36 @@ buildPythonPackage rec {
hash = "sha256-V0f3mXCfqwH2l3OtJKOHGdrlKAFxs2ynqXvNve7Amkc=";
};

propagatedBuildInputs = [ flask flask-sessionstore captcha ];
patches = [
(fetchpatch {
# https://github.com/Tethik/flask-session-captcha/pull/44
url = "https://github.com/Tethik/flask-session-captcha/commit/3f79c22a71c60dd60e9df61b550cce641603dcb6.patch";
hash = "sha256-MXsoSytBNbcg3HU6IWlvf2MgNUL78T5ToxKGv4YMtZw=";
})
];

nativeBuildInputs = [
setuptools
];

pythonImportsCheck = [ "flask_session_captcha" ];
propagatedBuildInputs = [
captcha
flask
markupsafe
];

nativeCheckInputs = [ flask-sqlalchemy pytestCheckHook ];
pythonImportsCheck = [
"flask_session_captcha"
];

# RuntimeError: Working outside of application context.
doCheck = false;

nativeCheckInputs = [
flask-sqlalchemy
pytestCheckHook
];

meta = with lib; {
description = "A captcha implemention for flask";
homepage = "https://github.com/Tethik/flask-session-captcha";
Expand Down

0 comments on commit 22e6903

Please sign in to comment.