From 022b5adf8ca65e800c8837a8d13a2c7e4a6dbf9f Mon Sep 17 00:00:00 2001 From: Ben Darwin Date: Sat, 15 Jun 2024 22:44:46 -0400 Subject: [PATCH] python312Packages.pylibjpeg-libjpeg: enable (passthru) tests --- .../pylibjpeg-libjpeg/default.nix | 93 +++++++++++-------- 1 file changed, 54 insertions(+), 39 deletions(-) diff --git a/pkgs/development/python-modules/pylibjpeg-libjpeg/default.nix b/pkgs/development/python-modules/pylibjpeg-libjpeg/default.nix index f9e60844a84f..4f54cca42a7b 100644 --- a/pkgs/development/python-modules/pylibjpeg-libjpeg/default.nix +++ b/pkgs/development/python-modules/pylibjpeg-libjpeg/default.nix @@ -8,47 +8,62 @@ poetry-core, setuptools, numpy, + pydicom, + pylibjpeg-data, + pylibjpeg, }: -buildPythonPackage rec { - pname = "pylibjpeg-libjpeg"; - version = "2.3.0"; - pyproject = true; +let + self = buildPythonPackage { + pname = "pylibjpeg-libjpeg"; + version = "2.3.0"; + pyproject = true; - disabled = pythonOlder "3.9"; + disabled = pythonOlder "3.9"; - src = fetchFromGitHub { - owner = "pydicom"; - repo = pname; - tag = "v${version}"; - hash = "sha256-xqSA1cutTsH9k4l9CW96n/CURzkAyDi3PZylZeedVjA="; - fetchSubmodules = true; + src = fetchFromGitHub { + owner = "pydicom"; + repo = "pylibjpeg-libjpeg"; + tag = "v${self.version}"; + hash = "sha256-xqSA1cutTsH9k4l9CW96n/CURzkAyDi3PZylZeedVjA="; + fetchSubmodules = true; + }; + + postPatch = '' + substituteInPlace pyproject.toml \ + --replace-fail 'poetry-core >=1.8,<2' 'poetry-core' + ''; + + build-system = [ + cython + poetry-core + setuptools + ]; + + dependencies = [ numpy ]; + + nativeCheckInputs = [ + pydicom + pylibjpeg-data + pylibjpeg + pytestCheckHook + ]; + + doCheck = false; # circular test dependency with `pylibjpeg` and `pydicom` + + passthru.tests.check = self.overridePythonAttrs (_: { + doCheck = true; + }); + + pythonImportsCheck = [ "libjpeg" ]; + + meta = { + description = "JPEG, JPEG-LS and JPEG XT plugin for pylibjpeg"; + homepage = "https://github.com/pydicom/pylibjpeg-libjpeg"; + changelog = "https://github.com/pydicom/pylibjpeg-libjpeg/releases/tag/v${self.version}"; + license = lib.licenses.gpl3Only; + maintainers = with lib.maintainers; [ bcdarwin ]; + }; }; - - postPatch = '' - substituteInPlace pyproject.toml \ - --replace-fail 'poetry-core >=1.8,<2' 'poetry-core' - ''; - - build-system = [ - cython - poetry-core - setuptools - ]; - - dependencies = [ numpy ]; - - nativeCheckInputs = [ pytestCheckHook ]; - - doCheck = false; # tests try to import 'libjpeg.data', which errors - - pythonImportsCheck = [ "libjpeg" ]; - - meta = with lib; { - description = "JPEG, JPEG-LS and JPEG XT plugin for pylibjpeg"; - homepage = "https://github.com/pydicom/pylibjpeg-libjpeg"; - changelog = "https://github.com/pydicom/pylibjpeg-libjpeg/releases/tag/v${version}"; - license = licenses.gpl3Only; - maintainers = with maintainers; [ bcdarwin ]; - }; -} +in +self