1{
2 lib,
3 asn1crypto,
4 buildPythonPackage,
5 fetchFromGitHub,
6 importlib-metadata,
7 pytest-mock,
8 pytestCheckHook,
9 pythonOlder,
10 setuptools,
11 wheel,
12}:
13
14buildPythonPackage rec {
15 pname = "scramp";
16 version = "1.4.4";
17 format = "pyproject";
18
19 disabled = pythonOlder "3.7";
20
21 src = fetchFromGitHub {
22 owner = "tlocke";
23 repo = "scramp";
24 rev = version;
25 hash = "sha256-WOyv1fLSXG7p+WKs2QSwlsh8FSK/lxp6I1hPY0VIkKo=";
26 };
27
28 nativeBuildInputs = [
29 setuptools
30 wheel
31 ];
32
33 propagatedBuildInputs = [ asn1crypto ] ++ lib.optionals (pythonOlder "3.8") [ importlib-metadata ];
34
35 nativeCheckInputs = [
36 pytest-mock
37 pytestCheckHook
38 ];
39
40 postPatch = ''
41 # Upstream uses versioningit to set the version
42 sed -i "/versioningit >=/d" pyproject.toml
43 sed -i '/^name =.*/a version = "${version}"' pyproject.toml
44 sed -i "/dynamic =/d" pyproject.toml
45 '';
46
47 pythonImportsCheck = [ "scramp" ];
48
49 disabledTests = [ "test_readme" ];
50
51 meta = with lib; {
52 description = "Implementation of the SCRAM authentication protocol";
53 homepage = "https://github.com/tlocke/scramp";
54 license = licenses.mit;
55 maintainers = with maintainers; [ jonringer ];
56 };
57}