diff --git a/pkgs/development/python-modules/flask-api/default.nix b/pkgs/development/python-modules/flask-api/default.nix index 9b4a398f7f79..e837dc71df37 100644 --- a/pkgs/development/python-modules/flask-api/default.nix +++ b/pkgs/development/python-modules/flask-api/default.nix @@ -2,14 +2,23 @@ , buildPythonPackage , pythonOlder , fetchFromGitHub +, fetchpatch + +# build-system +, setuptools + +# dependencies , flask + +# tests , markdown +, pytestCheckHook }: buildPythonPackage rec { - pname = "Flask-API"; + pname = "flask-api"; version = "3.1"; - format = "setuptools"; + pyproject = true; disabled = pythonOlder "3.6"; @@ -20,9 +29,25 @@ buildPythonPackage rec { hash = "sha256-nHgeI5FLKkDp4uWO+0eaT4YSOMkeQ0wE3ffyJF+WzTM="; }; + patches = [ + (fetchpatch { + # werkzeug 3.0 support + url = "https://github.com/flask-api/flask-api/commit/9c998897f67d8aa959dc3005d7d22f36568b6938.patch"; + hash = "sha256-vaCZ4gVlfQXyeksA44ydkjz2FxODHt3gTTP+ukJwEGY="; + }) + ]; + + nativeBuildInputs = [ + setuptools + ]; + propagatedBuildInputs = [ flask + ]; + + nativeCheckInputs = [ markdown + pytestCheckHook ]; meta = with lib; { diff --git a/pkgs/development/python-modules/flask-autoindex/default.nix b/pkgs/development/python-modules/flask-autoindex/default.nix deleted file mode 100644 index c8e14eaf35e3..000000000000 --- a/pkgs/development/python-modules/flask-autoindex/default.nix +++ /dev/null @@ -1,51 +0,0 @@ -{ lib -, buildPythonPackage -, fetchPypi -, flask -, flask-silk -, future -, pythonOlder -, unittestCheckHook -}: - -buildPythonPackage rec { - pname = "flask-autoindex"; - version = "0.6.6"; - format = "setuptools"; - - disabled = pythonOlder "3.7"; - - src = fetchPypi { - pname = "Flask-AutoIndex"; - inherit version; - sha256 = "ea319f7ccadf68ddf98d940002066278c779323644f9944b300066d50e2effc7"; - }; - - propagatedBuildInputs = [ - flask - flask-silk - future - ]; - - nativeCheckInputs = [ - unittestCheckHook - ]; - - pythonImportsCheck = [ - "flask_autoindex" - ]; - - meta = with lib; { - description = "The mod_autoindex for Flask"; - longDescription = '' - Flask-AutoIndex generates an index page for your Flask application automatically. - The result is just like mod_autoindex, but the look is more awesome! - ''; - homepage = "https://flask-autoindex.readthedocs.io/"; - changelog = "https://github.com/general03/flask-autoindex/blob/v${version}/CHANGELOG.md"; - license = licenses.bsd2; - maintainers = teams.sage.members; - # https://github.com/general03/flask-autoindex/issues/67 - broken = true; - }; -} diff --git a/pkgs/development/python-modules/flask-basicauth/default.nix b/pkgs/development/python-modules/flask-basicauth/default.nix deleted file mode 100644 index 97a214744457..000000000000 --- a/pkgs/development/python-modules/flask-basicauth/default.nix +++ /dev/null @@ -1,55 +0,0 @@ -{ lib -, buildPythonPackage -, fetchFromGitHub -, fetchpatch -, flask -, python -}: - -buildPythonPackage rec { - pname = "flask-basicauth"; - version = "0.2.0"; - format = "setuptools"; - - src = fetchFromGitHub { - owner = "jpvanhal"; - repo = pname; - rev = "v${version}"; - hash = "sha256-han0OjMI1XmuWKHGVpk+xZB+/+cpV1I+659zOG3hcPY="; - }; - - patches = [ - (fetchpatch { - # The unit tests fail due to an invalid import: - # from flask.ext.basicauth import BasicAuth - # - # This patch replaces it with the correct import: - # from flask_basicauth import BasicAuth - # - # The patch uses the changes from this pull request, - # and therefore can be removed once this pull request - # has been merged: - # https://github.com/jpvanhal/flask-basicauth/pull/29 - name = "fix-test-flask-ext-imports.patch"; - url = "https://github.com/jpvanhal/flask-basicauth/commit/23f57dc1c3d85ea6fc7f468e8d8c6f19348a0a81.patch"; - hash = "sha256-njUYjO0TRe3vr5D0XjIfCNcsFlShbGxtFV/DJerAKDE="; - }) - ]; - - propagatedBuildInputs = [ flask ]; - - checkPhase = '' - runHook preCheck - ${python.interpreter} -m unittest discover - runHook postCheck - ''; - - pythonImportsCheck = [ "flask_basicauth" ]; - - meta = with lib; { - homepage = "https://github.com/jpvanhal/flask-basicauth"; - description = "HTTP basic access authentication for Flask"; - license = licenses.mit; - maintainers = with maintainers; [ wesnel ]; - }; -} diff --git a/pkgs/development/python-modules/flask-gravatar/default.nix b/pkgs/development/python-modules/flask-gravatar/default.nix index a52feb8aecbf..1a305f017cee 100644 --- a/pkgs/development/python-modules/flask-gravatar/default.nix +++ b/pkgs/development/python-modules/flask-gravatar/default.nix @@ -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"; diff --git a/pkgs/development/python-modules/flask-restful/default.nix b/pkgs/development/python-modules/flask-restful/default.nix index 68072b7ddde9..3107d4c7f5bc 100644 --- a/pkgs/development/python-modules/flask-restful/default.nix +++ b/pkgs/development/python-modules/flask-restful/default.nix @@ -29,6 +29,8 @@ buildPythonPackage rec { # conditional so that overrides are easier for web applications patches = lib.optionals (lib.versionAtLeast werkzeug.version "2.1.0") [ ./werkzeug-2.1.0-compat.patch + ] ++ lib.optionals (lib.versionAtLeast flask.version "3.0.0") [ + ./flask-3.0-compat.patch ]; propagatedBuildInputs = [ diff --git a/pkgs/development/python-modules/flask-restful/flask-3.0-compat.patch b/pkgs/development/python-modules/flask-restful/flask-3.0-compat.patch new file mode 100644 index 000000000000..c78105e72282 --- /dev/null +++ b/pkgs/development/python-modules/flask-restful/flask-3.0-compat.patch @@ -0,0 +1,24 @@ +diff --git a/tests/test_api.py b/tests/test_api.py +index 582ee5a..20db1f5 100644 +--- a/tests/test_api.py ++++ b/tests/test_api.py +@@ -1,7 +1,7 @@ + import unittest + import json + from flask import Flask, Blueprint, redirect, views, abort as flask_abort +-from flask.signals import got_request_exception, signals_available ++from flask.signals import got_request_exception + try: + from mock import Mock + except: +@@ -491,10 +491,6 @@ class APITestCase(unittest.TestCase): + self.assertEqual(api.default_mediatype, resp.headers['Content-Type']) + + def test_handle_error_signal(self): +- if not signals_available: +- # This test requires the blinker lib to run. +- print("Can't test signals without signal support") +- return + app = Flask(__name__) + api = flask_restful.Api(app) + diff --git a/pkgs/development/python-modules/flask-session-captcha/default.nix b/pkgs/development/python-modules/flask-session-captcha/default.nix index a720d2a4b555..8a71b99c1539 100644 --- a/pkgs/development/python-modules/flask-session-captcha/default.nix +++ b/pkgs/development/python-modules/flask-session-captcha/default.nix @@ -1,17 +1,25 @@ { lib , fetchFromGitHub +, fetchpatch , buildPythonPackage -, flask -, flask-sessionstore -, flask-sqlalchemy + +# build-system +, setuptools + +# dependencies , captcha +, flask +, markupsafe + +# tests +, flask-sqlalchemy , pytestCheckHook }: buildPythonPackage rec { pname = "flask-session-captcha"; version = "1.3.0"; - format = "setuptools"; + pyproject = true; src = fetchFromGitHub { owner = "Tethik"; @@ -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="; + }) + ]; - pythonImportsCheck = [ "flask_session_captcha" ]; + nativeBuildInputs = [ + setuptools + ]; - nativeCheckInputs = [ flask-sqlalchemy pytestCheckHook ]; + propagatedBuildInputs = [ + captcha + flask + markupsafe + ]; + + 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"; diff --git a/pkgs/development/python-modules/flask-sessionstore/default.nix b/pkgs/development/python-modules/flask-sessionstore/default.nix deleted file mode 100644 index 12f3ff51b425..000000000000 --- a/pkgs/development/python-modules/flask-sessionstore/default.nix +++ /dev/null @@ -1,35 +0,0 @@ -{ lib -, fetchPypi -, buildPythonPackage -, flask -, nose -}: - -buildPythonPackage rec { - pname = "flask-sessionstore"; - version = "0.4.5"; - format = "setuptools"; - - src = fetchPypi { - pname = "Flask-Sessionstore"; - inherit version; - hash = "sha256-AQ3jWrnw2UI8L3nFEx4AhDwGP4R8Tr7iBMsDS5jLQPQ="; - }; - - propagatedBuildInputs = [ flask ]; - - pythonImportsCheck = [ "flask_sessionstore" ]; - - nativeCheckInputs = [ nose ]; - - checkPhase = '' - nosetests -s - ''; - - meta = with lib; { - description = "Session Storage Backends for Flask"; - homepage = "https://github.com/mcrowson/flask-sessionstore"; - license = licenses.bsd3; - maintainers = with maintainers; [ Flakebi ]; - }; -} diff --git a/pkgs/development/python-modules/flask/default.nix b/pkgs/development/python-modules/flask/default.nix index 154625f6c52a..083cf33c88fd 100644 --- a/pkgs/development/python-modules/flask/default.nix +++ b/pkgs/development/python-modules/flask/default.nix @@ -1,18 +1,28 @@ { lib , buildPythonPackage , fetchPypi -, asgiref +, pythonOlder + +# build-system +, flit-core + +# dependencies , blinker , click -, flit-core , importlib-metadata , itsdangerous , jinja2 -, python-dotenv , werkzeug + +# optional-dependencies +, asgiref +, python-dotenv + +# tests +, greenlet , pytestCheckHook -, pythonOlder - # used in passthru.tests + +# reverse dependencies , flask-limiter , flask-restful , flask-restx @@ -21,12 +31,12 @@ buildPythonPackage rec { pname = "flask"; - version = "2.3.3"; + version = "3.0.1"; format = "pyproject"; src = fetchPypi { inherit pname version; - hash = "sha256-CcNHqSqn/0qOfzIGeV8w2CZlS684uHPQdEzVccpgnvw="; + hash = "sha256-ZIn1G7Nmbe9vMU4V8Z1QoYaaGa4OjJo2Qf/mbHfUJAM="; }; nativeBuildInputs = [ @@ -39,21 +49,31 @@ buildPythonPackage rec { itsdangerous jinja2 werkzeug - ] ++ lib.optional (pythonOlder "3.10") importlib-metadata; + ] ++ lib.optionals (pythonOlder "3.10") [ + importlib-metadata + ]; + + passthru.optional-dependencies = { + async = [ + asgiref + ]; + dotenv = [ + python-dotenv + ]; + }; nativeCheckInputs = [ pytestCheckHook - ]; + ] ++ lib.optionals (pythonOlder "3.11") [ + greenlet + ] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies); passthru.tests = { inherit flask-limiter flask-restful flask-restx moto; }; - passthru.optional-dependencies = { - dotenv = [ python-dotenv ]; - async = [ asgiref ]; - }; meta = with lib; { + changelog = "https://flask.palletsprojects.com/en/${versions.majorMinor version}.x/changes/#version-${replaceStrings [ "." ] [ "-" ] version}"; homepage = "https://flask.palletsprojects.com/"; description = "The Python micro framework for building web applications"; longDescription = '' diff --git a/pkgs/development/python-modules/httpbin/default.nix b/pkgs/development/python-modules/httpbin/default.nix index 48de08ee3b4c..0fbc8bc73ee9 100644 --- a/pkgs/development/python-modules/httpbin/default.nix +++ b/pkgs/development/python-modules/httpbin/default.nix @@ -1,6 +1,7 @@ { lib , buildPythonPackage , fetchPypi +, fetchpatch , pythonRelaxDepsHook # build-system @@ -33,6 +34,14 @@ buildPythonPackage rec { hash = "sha256-e4WWvrDnWntlPDnR888mPW1cR20p4d9ve7K3C/nwaj0="; }; + patches = [ + (fetchpatch { + # backport flask 3.0 support; drop after 0.10.1 + url = "https://github.com/psf/httpbin/commit/c1d9e33049263fed3cb27806a97f094acc350905.patch"; + hash = "sha256-SYJgQN3ERDgLIaBc4eqDfey+EX4z6CSxLoAA7j+16xI="; + }) + ]; + nativeBuildInputs = [ setuptools pythonRelaxDepsHook diff --git a/pkgs/development/python-modules/json-logging/default.nix b/pkgs/development/python-modules/json-logging/default.nix index a3ac3ff7f005..3d22f4e878ba 100644 --- a/pkgs/development/python-modules/json-logging/default.nix +++ b/pkgs/development/python-modules/json-logging/default.nix @@ -6,6 +6,7 @@ , httpx , pytestCheckHook , pythonOlder +, quart , requests , sanic , uvicorn @@ -31,7 +32,7 @@ buildPythonPackage rec { flask httpx pytestCheckHook - # quart + quart requests sanic uvicorn diff --git a/pkgs/development/python-modules/quart/default.nix b/pkgs/development/python-modules/quart/default.nix index 6cf51d6920ff..1effbadf3b67 100644 --- a/pkgs/development/python-modules/quart/default.nix +++ b/pkgs/development/python-modules/quart/default.nix @@ -1,6 +1,7 @@ { lib , buildPythonPackage , fetchFromGitHub +, pythonOlder # build-system , poetry-core @@ -9,6 +10,7 @@ , aiofiles , blinker , click +, flask , hypercorn , importlib-metadata , itsdangerous @@ -29,14 +31,14 @@ buildPythonPackage rec { pname = "quart"; - version = "0.18.4"; + version = "0.19.4"; format = "pyproject"; src = fetchFromGitHub { owner = "pallets"; repo = "quart"; rev = "refs/tags/${version}"; - hash = "sha256-iT/pePUtH1hwNIOG8Y/YbqCVseNXVOKC0nrXfB2RTlQ="; + hash = "sha256-EgCZ0AXK2vGxo55BWAcDVv6zNUrWNbAYNnEXEBJk+84="; }; nativeBuildInputs = [ @@ -52,15 +54,17 @@ buildPythonPackage rec { aiofiles blinker click + flask hypercorn - importlib-metadata itsdangerous jinja2 markupsafe pydata-sphinx-theme python-dotenv - typing-extensions werkzeug + ] ++ lib.optionals (pythonOlder "3.10") [ + importlib-metadata + typing-extensions ]; pythonImportsCheck = [ @@ -75,11 +79,6 @@ buildPythonPackage rec { pytestCheckHook ]; - disabledTestPaths = [ - # remove after 0.18.4 - "tests/test_signals.py" - ]; - meta = with lib; { description = "An async Python micro framework for building web applications"; homepage = "https://github.com/pallets/quart/"; diff --git a/pkgs/development/python-modules/sentry-sdk/default.nix b/pkgs/development/python-modules/sentry-sdk/default.nix index 11d1df937702..e89d8ca0e32f 100644 --- a/pkgs/development/python-modules/sentry-sdk/default.nix +++ b/pkgs/development/python-modules/sentry-sdk/default.nix @@ -27,6 +27,7 @@ , pytest-watch , pytestCheckHook , pythonOlder +, quart , rq , sanic , setuptools @@ -96,7 +97,7 @@ buildPythonPackage rec { pure-eval ]; quart = [ - # quart missing + quart blinker ]; rq = [ diff --git a/pkgs/development/python-modules/werkzeug/default.nix b/pkgs/development/python-modules/werkzeug/default.nix index 35c5f943cb19..e59eda006e6e 100644 --- a/pkgs/development/python-modules/werkzeug/default.nix +++ b/pkgs/development/python-modules/werkzeug/default.nix @@ -3,27 +3,39 @@ , buildPythonPackage , pythonOlder , fetchPypi + +# build-system , flit-core + +# dependencies +, markupsafe + +# optional-dependencies , watchdog + +# tests +, cryptography , ephemeral-port-reserve +, greenlet , pytest-timeout , pytest-xprocess , pytestCheckHook -, markupsafe -# for passthru.tests -, moto, sentry-sdk + +# reverse dependencies +, moto +, sentry-sdk }: buildPythonPackage rec { pname = "werkzeug"; - version = "2.3.8"; + version = "3.0.1"; format = "pyproject"; disabled = pythonOlder "3.8"; src = fetchPypi { inherit pname version; - hash = "sha256-VUslfHS763oNJUFgpPj/4YUkP1KlIDUGC3Ycpi2XfwM="; + hash = "sha256-UH6BHs6nKxikBJR63tSzOQ4duPgmtJTXZVDvRbs7Hcw="; }; nativeBuildInputs = [ @@ -36,16 +48,19 @@ buildPythonPackage rec { passthru.optional-dependencies = { watchdog = lib.optionals (!stdenv.isDarwin) [ - # watchdog requires macos-sdk 10.13[ + # watchdog requires macos-sdk 10.13 watchdog ]; }; nativeCheckInputs = [ + cryptography ephemeral-port-reserve pytest-timeout pytest-xprocess pytestCheckHook + ] ++ lib.optionals (pythonOlder "3.11") [ + greenlet ] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies); disabledTests = lib.optionals stdenv.isDarwin [ @@ -68,6 +83,7 @@ buildPythonPackage rec { }; meta = with lib; { + changelog = "https://werkzeug.palletsprojects.com/en/${versions.majorMinor version}.x/changes/#version-${replaceStrings [ "." ] [ "-" ] version}"; homepage = "https://palletsprojects.com/p/werkzeug/"; description = "The comprehensive WSGI web application library"; longDescription = '' diff --git a/pkgs/top-level/python-aliases.nix b/pkgs/top-level/python-aliases.nix index ad98e21d5ef5..28f5d193e213 100644 --- a/pkgs/top-level/python-aliases.nix +++ b/pkgs/top-level/python-aliases.nix @@ -164,6 +164,9 @@ mapAliases ({ flask_sqlalchemy = flask-sqlalchemy; # added 2022-07-20 flask_testing = flask-testing; # added 2022-04-25 flask_wtf = flask-wtf; # added 2022-05-24 + flask-autoindex = throw "flask-autoindex was removed, as it is not compatible with flask 3.0 and unmaintained since 2020."; + flask-basicauth = throw "flask-basicauth was removed, as it is not compatible with flask 3.0 and unmaintained since 2016."; + flask-sessionstore = throw "flask-sessionstore was removed, as it is not compatible with flask 3.0 and unmaintained since 2017."; flowlogs_reader = flowlogs-reader; # added 2024-01-03 FormEncode = formencode; # added 2023-02-19 foundationdb51 = throw "foundationdb51 is no longer maintained, use foundationdb71 instead"; # added 2023-06-06 diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index b386432808eb..a1f857d774fe 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -4097,14 +4097,10 @@ self: super: with self; { flask-assets = callPackage ../development/python-modules/flask-assets { }; - flask-autoindex = callPackage ../development/python-modules/flask-autoindex { }; - flask-babel = callPackage ../development/python-modules/flask-babel { }; flask-babelex = callPackage ../development/python-modules/flask-babelex { }; - flask-basicauth = callPackage ../development/python-modules/flask-basicauth { }; - flask-bcrypt = callPackage ../development/python-modules/flask-bcrypt { }; flask-bootstrap = callPackage ../development/python-modules/flask-bootstrap { }; @@ -4171,8 +4167,6 @@ self: super: with self; { flask-session-captcha = callPackage ../development/python-modules/flask-session-captcha { }; - flask-sessionstore = callPackage ../development/python-modules/flask-sessionstore { }; - flask-security-too = callPackage ../development/python-modules/flask-security-too { }; flask-silk = callPackage ../development/python-modules/flask-silk { };