From f7658bd2fbcf876afd2e8b8dab90f25621c9816e Mon Sep 17 00:00:00 2001 From: kilyanni Date: Thu, 30 Apr 2026 21:55:33 +0200 Subject: [PATCH] python3Packages.cyscale: init at 0.3.2 --- .../python-modules/cyscale/default.nix | 53 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 55 insertions(+) create mode 100644 pkgs/development/python-modules/cyscale/default.nix diff --git a/pkgs/development/python-modules/cyscale/default.nix b/pkgs/development/python-modules/cyscale/default.nix new file mode 100644 index 000000000000..ac55c72ae78e --- /dev/null +++ b/pkgs/development/python-modules/cyscale/default.nix @@ -0,0 +1,53 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + setuptools, + more-itertools, + base58, + pytestCheckHook, +}: + +buildPythonPackage (finalAttrs: { + pname = "cyscale"; + version = "0.3.2"; + pyproject = true; + + __structuredAttrs = true; + + src = fetchFromGitHub { + owner = "latent-to"; + repo = "cyscale"; + tag = "v${finalAttrs.version}"; + hash = "sha256-L75xuo4LWfTMs1XYV8zSPtmxqgjWin9wcALDUjz5L1k="; + }; + + build-system = [ setuptools ]; + + dependencies = [ + more-itertools + base58 + ]; + + nativeCheckInputs = [ pytestCheckHook ]; + + # test_valid_type_registry_presets walks ../scalecodec/type_registry relative + # to the test file, which no longer exists after removing the source package dir + disabledTests = [ "test_valid_type_registry_presets" ]; + + # remove source package so tests import the installed Cython extensions, not the .pyx sources + preCheck = '' + rm -rf scalecodec + ''; + + pythonImportsCheck = [ "scalecodec" ]; + + meta = { + description = "Cython-accelerated SCALE codec library for Substrate-based blockchains (Polkadot, Kusama, Bittensor, etc.)"; + longDescription = "A drop-in replacement for py-scale-codec — same scalecodec module name, same public API, compiled with Cython for improved throughput."; + homepage = "https://github.com/latent-to/cyscale"; + changelog = "https://github.com/latent-to/cyscale/releases/tag/${finalAttrs.src.tag}"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ kilyanni ]; + }; +}) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 770ef1bcca24..db3300659ab9 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3490,6 +3490,8 @@ self: super: with self; { cyrtranslit = callPackage ../development/python-modules/cyrtranslit { }; + cyscale = callPackage ../development/python-modules/cyscale { }; + cysignals = callPackage ../development/python-modules/cysignals { }; cython = callPackage ../development/python-modules/cython { };