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 { };