1{
2 lib,
3 buildPythonPackage,
4 deprecation,
5 fetchFromGitHub,
6 jwcrypto,
7 poetry-core,
8 pythonOlder,
9 requests,
10 requests-toolbelt,
11}:
12
13buildPythonPackage rec {
14 pname = "python-keycloak";
15 version = "4.0.0";
16 pyproject = true;
17
18 disabled = pythonOlder "3.8";
19
20 src = fetchFromGitHub {
21 owner = "marcospereirampj";
22 repo = "python-keycloak";
23 tag = "v${version}";
24 hash = "sha256-ZXS29bND4GsJNhTGiUsLo+4FYd8Tubvg/+PJ33tqovY=";
25 };
26
27 postPatch = ''
28 # Upstream doesn't set version
29 substituteInPlace pyproject.toml \
30 --replace-fail 'version = "0.0.0"' 'version = "${version}"'
31 '';
32
33 build-system = [ poetry-core ];
34
35 dependencies = [
36 deprecation
37 jwcrypto
38 requests
39 requests-toolbelt
40 ];
41
42 # Test fixtures require a running keycloak instance
43 doCheck = false;
44
45 pythonImportsCheck = [ "keycloak" ];
46
47 meta = with lib; {
48 description = "Provides access to the Keycloak API";
49 homepage = "https://github.com/marcospereirampj/python-keycloak";
50 changelog = "https://github.com/marcospereirampj/python-keycloak/blob/v${version}/CHANGELOG.md";
51 license = licenses.mit;
52 maintainers = [ ];
53 };
54}