From dcf8ea60144743a385f962e65255f2ca9d1d5490 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 18 May 2024 20:00:44 +0200 Subject: [PATCH 1/2] python312Packages.pillow-jpls: refactor --- .../python-modules/pillow-jpls/default.nix | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/pkgs/development/python-modules/pillow-jpls/default.nix b/pkgs/development/python-modules/pillow-jpls/default.nix index 6f5b77c50e4c..87c697d45209 100644 --- a/pkgs/development/python-modules/pillow-jpls/default.nix +++ b/pkgs/development/python-modules/pillow-jpls/default.nix @@ -32,11 +32,17 @@ buildPythonPackage rec { hash = "sha256-Rc4/S8BrYoLdn7eHDBaoUt1Qy+h0TMAN5ixCAuRmfPU="; }; + env.SETUPTOOLS_SCM_PRETEND_VERSION = version; + + dontUseCmakeConfigure = true; + postPatch = '' - substituteInPlace pyproject.toml --replace '"conan~=2.0.16",' "" + substituteInPlace pyproject.toml \ + --replace-fail '"conan~=2.0.16",' "" \ + --replace-fail '"pybind11~=2.11.1",' '"pybind11",' ''; - nativeBuildInputs = [ + build-system = [ cmake ninja pybind11 @@ -44,12 +50,14 @@ buildPythonPackage rec { setuptools setuptools-scm ]; + buildInputs = [ charls eigen fmt ]; - propagatedBuildInputs = [ + + dependencies = [ numpy pillow pathspec @@ -57,14 +65,10 @@ buildPythonPackage rec { ]; pypaBuildFlags = [ "-C" "cmake.args='--preset=sysdeps'" ]; - dontUseCmakeConfigure = true; - env.SETUPTOOLS_SCM_PRETEND_VERSION = version; + nativeCheckInputs = [ pytestCheckHook ]; - checkInputs = [ - pytestCheckHook - ]; - # prevent importing from build during test collection: + # Prevent importing from build during test collection: preCheck = ''rm -rf pillow_jpls''; pythonImportsCheck = [ @@ -74,6 +78,7 @@ buildPythonPackage rec { meta = with lib; { description = "A JPEG-LS plugin for the Python Pillow library"; homepage = "https://github.com/planetmarshall/pillow-jpls"; + changelog = "https://github.com/planetmarshall/pillow-jpls/releases/tag/v${version}"; license = licenses.bsd3; maintainers = with maintainers; [ bcdarwin ]; }; From 362c7c7fc077d5671fd9e079ac878fbd29c34c32 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 18 May 2024 20:01:15 +0200 Subject: [PATCH 2/2] python312Packages.pillow-jpls: format with nixftm --- .../python-modules/pillow-jpls/default.nix | 46 ++++++++++--------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/pkgs/development/python-modules/pillow-jpls/default.nix b/pkgs/development/python-modules/pillow-jpls/default.nix index 87c697d45209..5ebc80e26460 100644 --- a/pkgs/development/python-modules/pillow-jpls/default.nix +++ b/pkgs/development/python-modules/pillow-jpls/default.nix @@ -1,21 +1,22 @@ -{ lib -, buildPythonPackage -, fetchFromGitHub -, pythonOlder -, pytestCheckHook -, cmake -, ninja -, scikit-build-core -, charls -, eigen -, fmt -, numpy -, pillow -, pybind11 -, setuptools -, pathspec -, pyproject-metadata -, setuptools-scm +{ + lib, + buildPythonPackage, + fetchFromGitHub, + pythonOlder, + pytestCheckHook, + cmake, + ninja, + scikit-build-core, + charls, + eigen, + fmt, + numpy, + pillow, + pybind11, + setuptools, + pathspec, + pyproject-metadata, + setuptools-scm, }: buildPythonPackage rec { @@ -64,16 +65,17 @@ buildPythonPackage rec { pyproject-metadata ]; - pypaBuildFlags = [ "-C" "cmake.args='--preset=sysdeps'" ]; + pypaBuildFlags = [ + "-C" + "cmake.args='--preset=sysdeps'" + ]; nativeCheckInputs = [ pytestCheckHook ]; # Prevent importing from build during test collection: preCheck = ''rm -rf pillow_jpls''; - pythonImportsCheck = [ - "pillow_jpls" - ]; + pythonImportsCheck = [ "pillow_jpls" ]; meta = with lib; { description = "A JPEG-LS plugin for the Python Pillow library";