diff --git a/pkgs/development/python-modules/cbor2/default.nix b/pkgs/development/python-modules/cbor2/default.nix index 2d64160724b3..fe400c474984 100644 --- a/pkgs/development/python-modules/cbor2/default.nix +++ b/pkgs/development/python-modules/cbor2/default.nix @@ -1,28 +1,52 @@ { lib, buildPythonPackage, - fetchPypi, + cargo, + fetchFromGitHub, hypothesis, pytest-cov-stub, pytestCheckHook, - setuptools-scm, + rustc, + rustPlatform, setuptools, + setuptools-rust, + setuptools-scm, withCExtensions ? true, }: -buildPythonPackage rec { +buildPythonPackage (finalAttrs: { pname = "cbor2"; - version = "5.8.0"; + version = "6.1.3"; pyproject = true; - src = fetchPypi { - inherit pname version; - hash = "sha256-sZw1/K6WiKwB73W61dsnMAwlN+tO4A7QfgXYRWoNSTE="; + src = fetchFromGitHub { + owner = "agronholm"; + repo = "cbor2"; + tag = finalAttrs.version; + hash = "sha256-DAhMoWZ820bfa7u+Mu+uqQ+ci+ibxQGwP70t4eOCHg8="; }; + cargoRoot = "rust"; + cargoDeps = rustPlatform.fetchCargoVendor { + inherit (finalAttrs) + pname + version + src + cargoRoot + ; + hash = "sha256-L9aYpPNGWf8h/NCjDwj5qper9sMSTCxPL91eIbb4hw0="; + }; + + nativeBuildInputs = [ + cargo + rustc + rustPlatform.cargoSetupHook + ]; + build-system = [ setuptools setuptools-scm + setuptools-rust ]; nativeCheckInputs = [ @@ -43,11 +67,11 @@ buildPythonPackage rec { meta = { description = "Python CBOR (de)serializer with extensive tag support"; - changelog = "https://github.com/agronholm/cbor2/releases/tag/${version}"; + changelog = "https://github.com/agronholm/cbor2/releases/tag/${finalAttrs.src.tag}"; homepage = "https://github.com/agronholm/cbor2"; license = lib.licenses.mit; maintainers = [ ]; mainProgram = "cbor2"; }; -} +})