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 '';
30
31 buildInputs = [
32 poetry-core
33 ];
34
35 propagatedBuildInputs = [
36 python-jose
37 urllib3
38 requests
39 requests-toolbelt
40 ];
41
42 # Test fixtures require a running keycloak instance
43 doTest = false;
44
45 pythonImportsCheck = [
46 "keycloak"
47 ];
48
49 meta = with lib; {
50 description = "Provides access to the Keycloak API";
51 homepage = "https://github.com/marcospereirampj/python-keycloak";
52 license = licenses.mit;
53 maintainers = with maintainers; [ costrouc ];
54 };
55}