From 9b36710b9f67bee3a6cce6768452ffe8b8a259e9 Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Tue, 1 Jul 2025 16:19:56 -0700 Subject: [PATCH] pythonPackages.pycodec2: init at 4.1.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: GaƩtan Lepage Co-authored-by: Benjamin Saunders --- .../python-modules/pycodec2/default.nix | 68 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 70 insertions(+) create mode 100644 pkgs/development/python-modules/pycodec2/default.nix diff --git a/pkgs/development/python-modules/pycodec2/default.nix b/pkgs/development/python-modules/pycodec2/default.nix new file mode 100644 index 000000000000..f226fa0725f7 --- /dev/null +++ b/pkgs/development/python-modules/pycodec2/default.nix @@ -0,0 +1,68 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + + # build-system + cython, + numpy, + setuptools, + + # buildInputs + codec2, + + pytestCheckHook, +}: + +buildPythonPackage (finalAttrs: { + pname = "pycodec2"; + version = "4.1.1"; + pyproject = true; + __structuredAttrs = true; + + src = fetchFromGitHub { + owner = "gregorias"; + repo = "pycodec2"; + tag = "v${finalAttrs.version}"; + hash = "sha256-DDO18uhAhZGaD04rAPinZhkNTww3ibEhw1uJwTtJYWk="; + }; + + postPatch = '' + substituteInPlace pyproject.toml \ + --replace-fail "numpy==2.1.*" "numpy" + ''; + + build-system = [ + cython + numpy + setuptools + ]; + + buildInputs = [ + codec2 + ]; + + dependencies = [ + numpy + ]; + + pythonImportsCheck = [ "pycodec2" ]; + + nativeCheckInputs = [ + pytestCheckHook + ]; + + preCheck = '' + rm -rf pycodec2 + ''; + + # The only test fails with a cryptic AssertionError + doCheck = false; + + meta = { + description = "Python's interface to codec 2"; + homepage = "https://github.com/gregorias/pycodec2"; + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ drupol ]; + }; +}) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index f4ff36be4137..ec2e4389352c 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -13703,6 +13703,8 @@ self: super: with self; { pycocotools = callPackage ../development/python-modules/pycocotools { }; + pycodec2 = callPackage ../development/python-modules/pycodec2 { }; + pycodestyle = callPackage ../development/python-modules/pycodestyle { }; pycognito = callPackage ../development/python-modules/pycognito { };