From 62478f38fd577fabb111526268fc1287c9885428 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Thu, 28 Nov 2024 11:48:25 +0100 Subject: [PATCH 1/2] python312Packages.mtcnn: 0.1.1 -> 1.0.0 Diff: https://github.com/ipazc/mtcnn/compare/3208d443a8f01d317c65d7c97a03bc0a6143c41d...v1.0.0 Changelog: https://github.com/ipazc/mtcnn/releases/tag/v1.0.0 --- .../python-modules/mtcnn/default.nix | 53 ++++++++++--------- 1 file changed, 29 insertions(+), 24 deletions(-) diff --git a/pkgs/development/python-modules/mtcnn/default.nix b/pkgs/development/python-modules/mtcnn/default.nix index a82f386c6e5d..1aa067411c6f 100644 --- a/pkgs/development/python-modules/mtcnn/default.nix +++ b/pkgs/development/python-modules/mtcnn/default.nix @@ -2,50 +2,55 @@ lib, buildPythonPackage, fetchFromGitHub, - opencv-python, - pytestCheckHook, - pythonOlder, + + # build-system setuptools, - tensorflow, + + # dependencies + joblib, + keras, + lz4, + pythonAtLeast, + distutils, + + # tests + pytestCheckHook, }: -buildPythonPackage { +buildPythonPackage rec { pname = "mtcnn"; - version = "0.1.1"; + version = "1.0.0"; pyproject = true; - disabled = pythonOlder "3.7"; - src = fetchFromGitHub { owner = "ipazc"; repo = "mtcnn"; - # No tags / releases; using commit: https://github.com/ipazc/mtcnn/commit/3208d443a8f01d317c65d7c97a03bc0a6143c41d - rev = "3208d443a8f01d317c65d7c97a03bc0a6143c41d"; - hash = "sha256-GXUrLJ5XD6V2hT/gjyYSuh/CMMw2xIXKBsYFvQmbLYs="; + rev = "refs/tags/v${version}"; + hash = "sha256-gp+jfa1arD3PpJpuRFKIUznV0Lyjt3DPn/HHUviDXhk="; }; - postPatch = '' - substituteInPlace setup.py \ - --replace-fail "setup, setuptools" "setup, find_packages"\ - --replace-fail "setuptools.find_packages" "find_packages"\ - --replace-fail "keras>=2.0.0" ""\ - --replace-fail "tests_require=['nose']," "" - ''; - build-system = [ setuptools ]; - dependencies = [ - opencv-python - tensorflow - ]; + dependencies = + [ + joblib + lz4 + ] + ++ lib.optionals (pythonAtLeast "3.12") [ + distutils + ]; pythonImportsCheck = [ "mtcnn" ]; - nativeCheckInputs = [ pytestCheckHook ]; + nativeCheckInputs = [ + keras + pytestCheckHook + ]; meta = { description = "MTCNN face detection implementation for TensorFlow"; homepage = "https://github.com/ipazc/mtcnn"; + changelog = "https://github.com/ipazc/mtcnn/releases/tag/v${version}"; license = lib.licenses.mit; maintainers = with lib.maintainers; [ derdennisop ]; }; From cc67534b921a5ece0d88b31e73721ef80ad51fbc Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Mon, 2 Dec 2024 18:36:34 +0100 Subject: [PATCH 2/2] python312Packages.retinaface: fix build --- .../python-modules/retinaface/default.nix | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/pkgs/development/python-modules/retinaface/default.nix b/pkgs/development/python-modules/retinaface/default.nix index f727d3f31158..457ea634d3c5 100644 --- a/pkgs/development/python-modules/retinaface/default.nix +++ b/pkgs/development/python-modules/retinaface/default.nix @@ -2,14 +2,21 @@ lib, buildPythonPackage, fetchFromGitHub, - gdown, - numpy, - opencv4, - pillow, - pytestCheckHook, - pythonOlder, + + # build-system setuptools, + + # dependencies + gdown, + keras, + numpy, + opencv-python, + pillow, tensorflow, + tf-keras, + + # tests + pytestCheckHook, }: buildPythonPackage rec { @@ -17,8 +24,6 @@ buildPythonPackage rec { version = "0.0.17"; pyproject = true; - disabled = pythonOlder "3.7"; - src = fetchFromGitHub { owner = "serengil"; repo = "retinaface"; @@ -26,13 +31,6 @@ buildPythonPackage rec { hash = "sha256-0s1CSGlK2bF1F2V/IuG2ZqD7CkNfHGvp1M5C3zDnuKs="; }; - postPatch = '' - # prevent collisions - substituteInPlace setup.py \ - --replace-fail "data_files=[(\"\", [\"README.md\", \"requirements.txt\", \"package_info.json\"])]," "" \ - --replace-fail "install_requires=requirements," "" - ''; - # requires internet connection disabledTestPaths = [ "tests/test_actions.py" @@ -44,10 +42,12 @@ buildPythonPackage rec { dependencies = [ gdown + keras numpy - opencv4 + opencv-python pillow tensorflow + tf-keras ]; nativeCheckInputs = [ pytestCheckHook ];