nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 fetchpatch,
6 freezegun,
7 isodate,
8 lxml,
9 pytestCheckHook,
10 poetry-core,
11 xmlsec,
12}:
13
14buildPythonPackage rec {
15 pname = "python3-saml";
16 version = "1.16.0";
17 pyproject = true;
18
19 src = fetchFromGitHub {
20 owner = "onelogin";
21 repo = "python3-saml";
22 tag = "v${version}";
23 hash = "sha256-KyDGmqhg/c29FaXPKK8rWKSBP6BOCpKKpOujCavXUcc=";
24 };
25
26 patches = [
27 # Fix build system, https://github.com/SAML-Toolkits/python3-saml/pull/341
28 (fetchpatch {
29 name = "switch-to-poetry-core.patch";
30 url = "https://github.com/SAML-Toolkits/python3-saml/commit/231a7e19543138fdd7424c01435dfe3f82bbe9ce.patch";
31 hash = "sha256-MvX1LXhf3LJUy3O7L0/ySyVY4KDGc/GKJud4pOkwVIk=";
32 })
33 ];
34
35 nativeBuildInputs = [ poetry-core ];
36
37 propagatedBuildInputs = [
38 isodate
39 lxml
40 xmlsec
41 ];
42
43 nativeCheckInputs = [
44 freezegun
45 pytestCheckHook
46 ];
47
48 pythonImportsCheck = [ "onelogin.saml2" ];
49
50 disabledTests = [
51 # Tests require network access or additions files
52 "OneLogin_Saml2_Metadata_Test"
53 "OneLogin_Saml2_Response_Test"
54 "OneLogin_Saml2_Utils_Test"
55 "OneLogin_Saml2_Settings_Test"
56 "OneLogin_Saml2_Auth_Test"
57 "OneLogin_Saml2_Authn_Request_Test"
58 "OneLogin_Saml2_IdPMetadataParser_Test"
59 "OneLogin_Saml2_Logout_Request_Test"
60 ];
61
62 meta = {
63 description = "OneLogin's SAML Python Toolkit";
64 homepage = "https://github.com/onelogin/python3-saml";
65 changelog = "https://github.com/SAML-Toolkits/python3-saml/blob/v${version}/changelog.md";
66 license = lib.licenses.mit;
67 maintainers = with lib.maintainers; [ zhaofengli ];
68 };
69}