From 2cd5fc1525e157f625b713c85e2ce598b6bd1ded Mon Sep 17 00:00:00 2001 From: eljamm Date: Mon, 12 Jan 2026 14:14:14 +0100 Subject: [PATCH] python3Packages.scim2-models: fix doc test; build from source --- .../python-modules/scim2-models/default.nix | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/pkgs/development/python-modules/scim2-models/default.nix b/pkgs/development/python-modules/scim2-models/default.nix index 3f2491c591fe..3bf220fd9227 100644 --- a/pkgs/development/python-modules/scim2-models/default.nix +++ b/pkgs/development/python-modules/scim2-models/default.nix @@ -1,22 +1,23 @@ { lib, buildPythonPackage, - fetchPypi, + fetchFromGitHub, hatchling, pydantic, pytestCheckHook, }: -buildPythonPackage rec { +buildPythonPackage (finalAttrs: { pname = "scim2-models"; version = "0.4.1"; pyproject = true; - src = fetchPypi { - inherit version; - pname = "scim2_models"; - hash = "sha256-SRUPO67otfZsrdjGQyTul5vIrYRU2WFaL0fvAtVd/1c="; + src = fetchFromGitHub { + owner = "python-scim"; + repo = "scim2-models"; + tag = finalAttrs.version; + hash = "sha256-cc9nSqED+gfBHC3QpeHnQ6lBnmvdHa6edp/WGiuiDfc="; }; build-system = [ hatchling ]; @@ -25,13 +26,18 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook ]; + preCheck = '' + substituteInPlace doc/tutorial.rst \ + --replace-fail "TzInfo(UTC)" "TzInfo(0)" + ''; + pythonImportsCheck = [ "scim2_models" ]; meta = { description = "SCIM2 models serialization and validation with pydantic"; homepage = "https://github.com/python-scim/scim2-models"; - changelog = "https://github.com/python-scim/scim2-models/releases/tag/${version}"; + changelog = "https://github.com/python-scim/scim2-models/releases/tag/${finalAttrs.version}"; license = lib.licenses.asl20; maintainers = with lib.maintainers; [ erictapen ]; }; -} +})