python312Packages.mtcnn: 0.1.1 -> 1.0.0; fix build (#361156)

This commit is contained in:
Gaétan Lepage
2024-12-04 14:03:04 +01:00
committed by GitHub
2 changed files with 45 additions and 40 deletions
@@ -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 ];
};
@@ -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 ];