1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 cargo,
6 rustPlatform,
7 rustc,
8 pyinstaller,
9
10 # dependencies
11 msgpack,
12
13 # testing
14 pydantic,
15 pytestCheckHook,
16 python-dateutil,
17 pytz,
18}:
19
20buildPythonPackage rec {
21 pname = "ormsgpack";
22 version = "1.10.0";
23 pyproject = true;
24
25 src = fetchFromGitHub {
26 owner = "aviramha";
27 repo = "ormsgpack";
28 tag = version;
29 hash = "sha256-7VESiHAkDynf31xrQQh0Vv5vSfMOjnVXRFackUQdB68=";
30 };
31
32 cargoDeps = rustPlatform.fetchCargoVendor {
33 inherit src;
34 hash = "sha256-um6PzwL0M5lz4gDkTO/lvWJ0wwuCneNKRW8qysKMmM0=";
35 };
36
37 build-system = [
38 cargo
39 rustPlatform.cargoSetupHook
40 rustPlatform.maturinBuildHook
41 rustc
42 ];
43
44 # requires nightly features (feature(portable_simd))
45 env.RUSTC_BOOTSTRAP = true;
46
47 dependencies = [
48 msgpack
49 ];
50
51 nativeBuildInputs = [
52 pyinstaller
53 ];
54
55 nativeCheckInputs = [
56 pytestCheckHook
57 pydantic
58 python-dateutil
59 pytz
60 ];
61
62 pythonImportsCheck = [
63 "ormsgpack"
64 ];
65
66 meta = {
67 description = "Fast msgpack serialization library for Python derived from orjson";
68 homepage = "https://github.com/aviramha/ormsgpack";
69 changelog = "https://github.com/aviramha/ormsgpack/releases/tag/${version}";
70 license = with lib.licenses; [
71 asl20
72 mit
73 ];
74 maintainers = with lib.maintainers; [ sarahec ];
75 };
76}