From 27d2ca56907b3ba51b5756ebfcedc760646ae819 Mon Sep 17 00:00:00 2001 From: Kerstin Humm Date: Mon, 17 Feb 2025 17:50:29 +0100 Subject: [PATCH 1/6] python3Packages.flask-alembic: init at 3.1.1 --- .../python-modules/flask-alembic/default.nix | 52 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 54 insertions(+) create mode 100644 pkgs/development/python-modules/flask-alembic/default.nix diff --git a/pkgs/development/python-modules/flask-alembic/default.nix b/pkgs/development/python-modules/flask-alembic/default.nix new file mode 100644 index 000000000000..7f4a80db80c4 --- /dev/null +++ b/pkgs/development/python-modules/flask-alembic/default.nix @@ -0,0 +1,52 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + pythonAtLeast, + flit-core, + alembic, + flask, + sqlalchemy, + pytestCheckHook, + flask-sqlalchemy, + flask-sqlalchemy-lite, +}: + +buildPythonPackage rec { + pname = "flask-alembic"; + version = "3.1.1"; + + pyproject = true; + + src = fetchFromGitHub { + owner = "pallets-eco"; + repo = "flask-alembic"; + tag = version; + hash = "sha256-iHJr9l3w1WwZXDl573IV7+A7RDcawGL20sxxhAQQ628="; + }; + + build-system = [ flit-core ]; + + dependencies = [ + alembic + flask + sqlalchemy + ]; + + nativeCheckInputs = [ + pytestCheckHook + flask-sqlalchemy + flask-sqlalchemy-lite + ]; + + pythonImportChecks = [ "flask_alembic" ]; + + meta = with lib; { + # https://github.com/pallets-eco/flask-alembic/issues/47 + broken = pythonAtLeast "3.13"; + homepage = "https://github.com/pallets-eco/flask-alembic"; + changelog = "https://github.com/pallets-eco/flask-alembic/blob/${src.tag}/CHANGES.md"; + license = licenses.mit; + maintainers = with maintainers; [ erictapen ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 68ea496ad81d..6beafc2cf715 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -4981,6 +4981,8 @@ self: super: with self; { flask-admin = callPackage ../development/python-modules/flask-admin { }; + flask-alembic = callPackage ../development/python-modules/flask-alembic { }; + flask-allowed-hosts = callPackage ../development/python-modules/flask-allowed-hosts { }; flask-api = callPackage ../development/python-modules/flask-api { }; From eacd5b9415fcc62b089dbfe8e3b371af6be2f48a Mon Sep 17 00:00:00 2001 From: Kerstin Humm Date: Wed, 19 Mar 2025 14:58:55 +0100 Subject: [PATCH 2/6] python3Packages.pytest-scim2-server: init at 0.1.2 --- .../pytest-scim2-server/default.nix | 49 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 51 insertions(+) create mode 100644 pkgs/development/python-modules/pytest-scim2-server/default.nix diff --git a/pkgs/development/python-modules/pytest-scim2-server/default.nix b/pkgs/development/python-modules/pytest-scim2-server/default.nix new file mode 100644 index 000000000000..17a6d8592c2d --- /dev/null +++ b/pkgs/development/python-modules/pytest-scim2-server/default.nix @@ -0,0 +1,49 @@ +{ + lib, + buildPythonPackage, + fetchPypi, + hatchling, + portpicker, + pytest, + scim2-server, + pytestCheckHook, + scim2-client, + cacert, +}: + +buildPythonPackage rec { + pname = "pytest-scim2-server"; + version = "0.1.2"; + + pyproject = true; + + # Pypi doesn't link a VCS repository + src = fetchPypi { + pname = "pytest_scim2_server"; + inherit version; + hash = "sha256-uWWFqkloTkvtIfpBNy93fa+c+b/FATjwytLKRde4bHg="; + }; + + build-system = [ hatchling ]; + + dependencies = [ + portpicker + pytest + scim2-server + ]; + + nativeCheckInputs = [ + pytestCheckHook + scim2-client + ] ++ scim2-client.optional-dependencies.httpx; + + env.SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt"; + + pythonImportsCheck = [ "pytest_scim2_server" ]; + + meta = { + homepage = "https://pypi.org/project/pytest-scim2-server"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ erictapen ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 6beafc2cf715..c04b7d762985 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -13786,6 +13786,8 @@ self: super: with self; { pytest-ruff = callPackage ../development/python-modules/pytest-ruff { }; + pytest-scim2-server = callPackage ../development/python-modules/pytest-scim2-server { }; + pytest-selenium = callPackage ../development/python-modules/pytest-selenium { }; pytest-server-fixtures = callPackage ../development/python-modules/pytest-server-fixtures { }; From d66bbf3b89306a8b5c9e9ecb5c710fc58369121d Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Thu, 3 Apr 2025 05:44:06 +0000 Subject: [PATCH 3/6] python312Packages.authlib: 1.5.1 -> 1.5.2 --- pkgs/development/python-modules/authlib/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/authlib/default.nix b/pkgs/development/python-modules/authlib/default.nix index fbea944cad91..e7297058ec04 100644 --- a/pkgs/development/python-modules/authlib/default.nix +++ b/pkgs/development/python-modules/authlib/default.nix @@ -20,7 +20,7 @@ buildPythonPackage rec { pname = "authlib"; - version = "1.5.1"; + version = "1.5.2"; pyproject = true; disabled = pythonOlder "3.8"; @@ -29,7 +29,7 @@ buildPythonPackage rec { owner = "lepture"; repo = "authlib"; tag = "v${version}"; - hash = "sha256-VMihaWqR4FbnTJ50fVf5e5B9GfVwRguq5UAC+D4bpxs="; + hash = "sha256-ra1RKprUAqhax0z1osl0lFgFENQZuSW/5FxSmsCdKNY="; }; build-system = [ setuptools ]; From d96cc44cd30be9b1515f1bb99b7b485a14fe69e9 Mon Sep 17 00:00:00 2001 From: Kerstin Humm Date: Fri, 31 Jan 2025 15:55:33 +0100 Subject: [PATCH 4/6] canaille: 0.0.57 -> 0.0.74 Changelog: https://gitlab.com/yaal/canaille/-/blob/0.0.74/CHANGES.rst --- nixos/tests/canaille.nix | 2 +- pkgs/by-name/ca/canaille/package.nix | 42 +++++++++++++++++----------- 2 files changed, 27 insertions(+), 17 deletions(-) diff --git a/nixos/tests/canaille.nix b/nixos/tests/canaille.nix index a085f695fd45..58e81e058de0 100644 --- a/nixos/tests/canaille.nix +++ b/nixos/tests/canaille.nix @@ -56,7 +56,7 @@ import ./make-test-python.nix ( server.succeed("sudo -iu canaille -- canaille create user --user-name admin --password adminpass --emails admin@${domain}") json_str = server.succeed("sudo -iu canaille -- canaille get user") assert json.loads(json_str)[0]["user_name"] == "admin" - server.succeed("sudo -iu canaille -- canaille check") + server.succeed("sudo -iu canaille -- canaille config check") ''; } ) diff --git a/pkgs/by-name/ca/canaille/package.nix b/pkgs/by-name/ca/canaille/package.nix index 7703ec0b7a4c..d53f3648d64e 100644 --- a/pkgs/by-name/ca/canaille/package.nix +++ b/pkgs/by-name/ca/canaille/package.nix @@ -2,6 +2,7 @@ lib, python3, fetchFromGitLab, + fetchpatch, openldap, nixosTests, }: @@ -11,7 +12,7 @@ let in python.pkgs.buildPythonApplication rec { pname = "canaille"; - version = "0.0.57"; + version = "0.0.74"; pyproject = true; disabled = python.pythonOlder "3.10"; @@ -20,9 +21,17 @@ python.pkgs.buildPythonApplication rec { owner = "yaal"; repo = "canaille"; rev = "refs/tags/${version}"; - hash = "sha256-pesN7k5kGHi3dqTMaXWdCsNsnaJxXv/Ku1wVC9N9a3k="; + hash = "sha256-FL02ADM7rUU43XR71UWr4FLr/NeUau7zRwTMOSFm1T4="; }; + patches = [ + # https://gitlab.com/yaal/canaille/-/merge_requests/275 + (fetchpatch { + url = "https://gitlab.com/yaal/canaille/-/commit/1c7fc8b1034a4423f7f46ad8adeced854910b702.patch"; + hash = "sha256-fu7D010NG7yUChOve7HY3e7mm2c/UGpfcTAiTU8BnGg="; + }) + ]; + build-system = with python.pkgs; [ hatchling babel @@ -32,10 +41,12 @@ python.pkgs.buildPythonApplication rec { dependencies = with python.pkgs; [ + blinker flask + flask-caching flask-wtf pydantic-settings - requests + httpx wtforms ] ++ sentry-sdk.optional-dependencies.flask; @@ -57,6 +68,7 @@ python.pkgs.buildPythonApplication rec { toml faker time-machine + pytest-scim2-server ] ++ optional-dependencies.front ++ optional-dependencies.oidc @@ -79,27 +91,34 @@ python.pkgs.buildPythonApplication rec { export SCHEMA="${openldap}/etc/schema" # Just use their example config for testing - export CONFIG=canaille/config.sample.toml + export CONFIG=tests/app/fixtures/default-config.toml ''; optional-dependencies = with python.pkgs; { front = [ email-validator flask-babel + flask-talisman flask-themer pycountry pytz - toml + tomlkit zxcvbn-rs-py ]; - oidc = [ authlib ]; + oidc = [ + authlib + joserfc + ]; scim = [ + httpx scim2-models authlib + scim2-client ]; ldap = [ python-ldap ]; sentry = [ sentry-sdk ]; postgresql = [ + flask-alembic passlib sqlalchemy sqlalchemy-json @@ -111,6 +130,7 @@ python.pkgs.buildPythonApplication rec { qrcode ]; sms = [ smpplib ]; + server = [ hypercorn ]; }; passthru = { @@ -120,16 +140,6 @@ python.pkgs.buildPythonApplication rec { }; }; - disabledTests = [ - # cause by authlib being too up-to-date for this version of canaille - # see: https://github.com/NixOS/nixpkgs/issues/389861#issuecomment-2726361949 - # FIX: update and see if this is fixed - "test_invalid_client[ldap_backend]" - "test_invalid_client[memory_backend]" - "test_invalid_client[sql_backend]" - "test_password_reset[sql_backend]" - ]; - meta = with lib; { description = "Lightweight Identity and Authorization Management"; homepage = "https://canaille.readthedocs.io/en/latest/index.html"; From fcca62a4c4c71af6f8f3b401b3dd724015c2816e Mon Sep 17 00:00:00 2001 From: Kerstin Humm Date: Tue, 29 Apr 2025 15:25:03 +0200 Subject: [PATCH 5/6] fittrackee: 0.9.4 -> 0.9.8 Diff: https://github.com/SamR1/FitTrackee/compare/refs/tags/v0.9.4...v0.9.8 Changelog: https://github.com/SamR1/FitTrackee/blob/v0.9.8/CHANGELOG.md --- pkgs/by-name/fi/fittrackee/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/fi/fittrackee/package.nix b/pkgs/by-name/fi/fittrackee/package.nix index f9b3d6c86070..2010c21d5f88 100644 --- a/pkgs/by-name/fi/fittrackee/package.nix +++ b/pkgs/by-name/fi/fittrackee/package.nix @@ -8,14 +8,14 @@ }: python3Packages.buildPythonApplication rec { pname = "fittrackee"; - version = "0.9.4"; + version = "0.9.8"; pyproject = true; src = fetchFromGitHub { owner = "SamR1"; repo = "FitTrackee"; tag = "v${version}"; - hash = "sha256-01lkPboF4KaCPnZHYVXUdIhXpJYGwcRPubnbjMm3mLY="; + hash = "sha256-WwyDDH/ucXyYF0uCaDPdb32Fof+UlM9eBNk11cyhH90="; }; build-system = [ From fb8b2a0ea0c054c717f68c75ed6a2d24958787e3 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Sun, 4 May 2025 14:24:35 +0300 Subject: [PATCH 6/6] matrix-synapse-unwrapped: fix compatibility with authlib-1.5.2 --- pkgs/by-name/ma/matrix-synapse-unwrapped/package.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkgs/by-name/ma/matrix-synapse-unwrapped/package.nix b/pkgs/by-name/ma/matrix-synapse-unwrapped/package.nix index cd1105642da4..d306a0c87be9 100644 --- a/pkgs/by-name/ma/matrix-synapse-unwrapped/package.nix +++ b/pkgs/by-name/ma/matrix-synapse-unwrapped/package.nix @@ -2,6 +2,7 @@ lib, stdenv, fetchFromGitHub, + fetchpatch, python3, openssl, libiconv, @@ -33,6 +34,15 @@ python3.pkgs.buildPythonApplication rec { hash = "sha256-PdAyEGLYmMLgcPQjzjuwvQo55olKgr079gsgQnUoKTM="; }; + patches = [ + # fix compatibility with authlib 1.5.2 + # https://github.com/element-hq/synapse/pull/18390 + (fetchpatch { + url = "https://github.com/element-hq/synapse/commit/c9adbc6a1ce6039b1c04ae3298e463a3e3b25c38.patch"; + hash = "sha256-0EZL0esZ6IEjmBV1whSpfZoFsMJ2yZQPi1GjW7NQ484="; + }) + ]; + postPatch = '' # Remove setuptools_rust from runtime dependencies # https://github.com/element-hq/synapse/blob/v1.69.0/pyproject.toml#L177-L185