1{
2 lib,
3 stdenv,
4 arrow,
5 buildPythonPackage,
6 cloudpickle,
7 cryptography,
8 fetchFromGitHub,
9 lz4,
10 numpy,
11 pytestCheckHook,
12 pythonOlder,
13 ruamel-yaml,
14 setuptools,
15}:
16
17buildPythonPackage rec {
18 pname = "construct";
19 version = "2.10.70";
20 pyproject = true;
21
22 disabled = pythonOlder "3.6";
23
24 src = fetchFromGitHub {
25 owner = "construct";
26 repo = "construct";
27 tag = "v${version}";
28 hash = "sha256-5otjjIyje0+z/Y/C2ivmu08PNm0oJcSSvZkQfGxHDuQ=";
29 };
30
31 nativeBuildInputs = [ setuptools ];
32
33 propagatedBuildInputs = [
34 # Not an explicit dependency, but it's imported by an entrypoint
35 lz4
36 ];
37
38 optional-dependencies = {
39 extras = [
40 arrow
41 cloudpickle
42 cryptography
43 numpy
44 ruamel-yaml
45 ];
46 };
47
48 nativeCheckInputs = [
49 pytestCheckHook
50 ] ++ lib.flatten (builtins.attrValues optional-dependencies);
51
52 pythonImportsCheck = [ "construct" ];
53
54 disabledTests = [
55 "test_benchmarks"
56 ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ "test_multiprocessing" ];
57
58 meta = with lib; {
59 description = "Powerful declarative parser (and builder) for binary data";
60 homepage = "https://construct.readthedocs.org/";
61 changelog = "https://github.com/construct/construct/releases/tag/v${version}";
62 license = licenses.mit;
63 maintainers = with maintainers; [ bjornfor ];
64 };
65}