1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 fetchpatch,
6 amazon-ion,
7 six,
8 pytestCheckHook,
9}:
10
11buildPythonPackage rec {
12 pname = "ionhash";
13 version = "1.2.1";
14 format = "setuptools";
15
16 src = fetchFromGitHub {
17 owner = "amzn";
18 repo = "ion-hash-python";
19 rev = "v${version}";
20 hash = "sha256-mXOLKXauWwwIA/LnF4qyZsBiF/QM+rF9MmE2ewmozYo=";
21 fetchSubmodules = true;
22 };
23
24 patches = [
25 (fetchpatch {
26 url = "https://github.com/amzn/ion-hash-python/commit/5cab56d694ecc176e394bb455c2d726ba1514ce0.patch";
27 hash = "sha256-P5QByNafgxI//e3m+b0oG00+rVymCsT/J4dOZSk3354=";
28 })
29 ];
30
31 postPatch = ''
32 substituteInPlace setup.py --replace "'pytest-runner'," ""
33 '';
34
35 propagatedBuildInputs = [
36 amazon-ion
37 six
38 ];
39
40 nativeCheckInputs = [ pytestCheckHook ];
41
42 pythonImportsCheck = [ "ionhash" ];
43
44 meta = with lib; {
45 description = "Python implementation of Amazon Ion Hash";
46 homepage = "https://github.com/amzn/ion-hash-python";
47 license = licenses.asl20;
48 maintainers = [ maintainers.terlar ];
49 broken = true; # last successful build 2023-09-28
50 };
51}