about summary refs log tree commit diff
path: root/pkgs/development/python-modules/python-keycloak/default.nix
blob: ea96e00abeaf7cb852b1857c2ecf44f78c5b86a1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
{ lib
, buildPythonPackage
, fetchFromGitHub
, poetry-core
, python-jose
, pythonOlder
, requests
, requests-toolbelt
, urllib3
}:

buildPythonPackage rec {
  pname = "python-keycloak";
  version = "2.6.0";
  format = "pyproject";

  disabled = pythonOlder "3.7";

  src = fetchFromGitHub {
    owner = "marcospereirampj";
    repo = "python-keycloak";
    rev = "v${version}";
    hash = "sha256-cuj0gJlZDkbJ2HRSMcQvO4nxpjw65CKGEpWCL5sucvg=";
  };

  postPatch = ''
    substituteInPlace pyproject.toml \
      --replace 'version = "0.0.0"' 'version = "${version}"'
  '';

  buildInputs = [
    poetry-core
  ];

  propagatedBuildInputs = [
    python-jose
    urllib3
    requests
    requests-toolbelt
  ];

  # Test fixtures require a running keycloak instance
  doTest = false;

  pythonImportsCheck = [
    "keycloak"
  ];

  meta = with lib; {
    description = "Provides access to the Keycloak API";
    homepage = "https://github.com/marcospereirampj/python-keycloak";
    license = licenses.mit;
    maintainers = with maintainers; [ costrouc ];
  };
}