diff --git a/pkgs/development/python-modules/ormsgpack/default.nix b/pkgs/development/python-modules/ormsgpack/default.nix new file mode 100644 index 000000000000..5b94c78db911 --- /dev/null +++ b/pkgs/development/python-modules/ormsgpack/default.nix @@ -0,0 +1,76 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + cargo, + rustPlatform, + rustc, + pyinstaller, + + # dependencies + msgpack, + + # testing + pydantic, + pytestCheckHook, + python-dateutil, + pytz, +}: + +buildPythonPackage rec { + pname = "ormsgpack"; + version = "1.9.1"; + pyproject = true; + + src = fetchFromGitHub { + owner = "aviramha"; + repo = "ormsgpack"; + tag = version; + hash = "sha256-lFKHXTYtYEjtu+nXemQnB0yjkFD69gr0n7XfJ1Hy3J0="; + }; + + cargoDeps = rustPlatform.fetchCargoVendor { + inherit src; + hash = "sha256-jOEryJcE5+b0Y588fbDSyPcz5h4zYz2+40+lIfRDV1M="; + }; + + build-system = [ + cargo + rustPlatform.cargoSetupHook + rustPlatform.maturinBuildHook + rustc + ]; + + # requires nightly features (feature(portable_simd)) + env.RUSTC_BOOTSTRAP = true; + + dependencies = [ + msgpack + ]; + + nativeBuildInputs = [ + pyinstaller + ]; + + nativeCheckInputs = [ + pytestCheckHook + pydantic + python-dateutil + pytz + ]; + + pythonImportsCheck = [ + "ormsgpack" + ]; + + meta = { + description = "Fast msgpack serialization library for Python derived from orjson"; + homepage = "https://github.com/aviramha/ormsgpack"; + changelog = "https://github.com/aviramha/ormsgpack/releases/tag/${version}"; + license = with lib.licenses; [ + asl20 + mit + ]; + maintainers = with lib.maintainers; [ sarahec ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index c30bcb888305..7270fd25d512 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -10414,6 +10414,8 @@ self: super: with self; { ormar = callPackage ../development/python-modules/ormar { }; + ormsgpack = callPackage ../development/python-modules/ormsgpack { }; + ortools = (toPythonModule (pkgs.or-tools.override { inherit (self) python; })).python; orvibo = callPackage ../development/python-modules/orvibo { };