1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, poetry-core
5, python-jose
6, pythonOlder
7, requests
8, requests-toolbelt
9, urllib3
10}:
11
12buildPythonPackage rec {
13 pname = "python-keycloak";
14 version = "2.6.0";
15 format = "pyproject";
16
17 disabled = pythonOlder "3.7";
18
19 src = fetchFromGitHub {
20 owner = "marcospereirampj";
21 repo = "python-keycloak";
22 rev = "v${version}";
23 hash = "sha256-cuj0gJlZDkbJ2HRSMcQvO4nxpjw65CKGEpWCL5sucvg=";
24 };
25
26 postPatch = ''
27 substituteInPlace pyproject.toml \
28 --replace 'version = "0.0.0"' 'version = "${version}"' \
29 --replace 'requests-toolbelt = "^0.9.1"' 'requests-toolbelt = "*"'
30 '';
31
32 buildInputs = [
33 poetry-core
34 ];
35
36 propagatedBuildInputs = [
37 python-jose
38 urllib3
39 requests
40 requests-toolbelt
41 ];
42
43 # Test fixtures require a running keycloak instance
44 doCheck = false;
45
46 pythonImportsCheck = [
47 "keycloak"
48 ];
49
50 meta = with lib; {
51 description = "Provides access to the Keycloak API";
52 homepage = "https://github.com/marcospereirampj/python-keycloak";
53 license = licenses.mit;
54 maintainers = with maintainers; [ ];
55 };
56}