1{
2 lib,
3 buildPythonPackage,
4 cbor2,
5 docopt,
6 fetchFromGitHub,
7 jsonconversion,
8 pytestCheckHook,
9 pythonOlder,
10 setuptools,
11 six,
12 tabulate,
13}:
14
15buildPythonPackage rec {
16 pname = "amazon-ion";
17 version = "0.13.0";
18 pyproject = true;
19
20 disabled = pythonOlder "3.7";
21
22 src = fetchFromGitHub {
23 owner = "amazon-ion";
24 repo = "ion-python";
25 tag = "v${version}";
26 # Test vectors require git submodule
27 fetchSubmodules = true;
28 hash = "sha256-ZnslVmXE2YvTAkpfw2lbpB+uF85n/CvA22htO/Y7yWk=";
29 };
30
31 postPatch = ''
32 substituteInPlace setup.py \
33 --replace "'pytest-runner'," ""
34 '';
35
36 nativeBuildInputs = [ setuptools ];
37
38 propagatedBuildInputs = [
39 jsonconversion
40 six
41 ];
42
43 nativeCheckInputs = [
44 cbor2
45 docopt
46 pytestCheckHook
47 tabulate
48 ];
49
50 disabledTests = [
51 # ValueError: Exceeds the limit (4300) for integer string conversion
52 "test_roundtrips"
53 ];
54
55 disabledTestPaths = [
56 # Exclude benchmarks
57 "tests/test_benchmark_cli.py"
58 ];
59
60 pythonImportsCheck = [ "amazon.ion" ];
61
62 meta = with lib; {
63 description = "Python implementation of Amazon Ion";
64 homepage = "https://github.com/amazon-ion/ion-python";
65 changelog = "https://github.com/amazon-ion/ion-python/releases/tag/${src.tag}";
66 sourceProvenance = with sourceTypes; [
67 fromSource
68 binaryNativeCode
69 ];
70 license = licenses.asl20;
71 maintainers = with maintainers; [ terlar ];
72 };
73}