python3Packages.face-recognition: rename and overhaul

- normalize name (PEP503)
- enable tests, all builders are AVX capable these days
- add explicit format
- reformat
This commit is contained in:
Martin Weinelt 2022-10-15 02:11:20 +02:00
parent 407230b409
commit 71b0473e22
No known key found for this signature in database
GPG Key ID: 87C1E9888F856759
4 changed files with 47 additions and 43 deletions

View File

@ -0,0 +1,45 @@
{ buildPythonPackage
, fetchPypi
, lib
# propagates
, click
, dlib
, face-recognition-models
, numpy
, pillow
# tests
, pytestCheckHook
}:
buildPythonPackage rec {
pname = "face-recognition";
version = "1.3.0";
format = "setuptools";
src = fetchPypi {
pname = "face_recognition";
inherit version;
hash = "sha256-Xl790WhqpWavDTzBMTsTHksZdleo/9A2aebT+tknBew=";
};
propagatedBuildInputs = [
click
dlib
face-recognition-models
numpy
pillow
];
checkInputs = [
pytestCheckHook
];
meta = with lib; {
license = licenses.mit;
homepage = "https://github.com/ageitgey/face_recognition";
maintainers = with maintainers; [ ];
description = "The world's simplest facial recognition api for Python and the command line";
};
}

View File

@ -1,42 +0,0 @@
{ buildPythonPackage, fetchFromGitHub, pillow, click, dlib, numpy
, face_recognition_models, lib, flake8, pytest, glibcLocales
}:
buildPythonPackage rec {
pname = "face_recognition";
version = "1.3.0";
src = fetchFromGitHub {
repo = pname;
owner = "ageitgey";
rev = "d34c622bf42e2c619505a4884017051ecf61ac77";
sha256 = "052878vnh3vbrsvmpgr0bx78k524dlxn47b2xakzbxk7dyjrgcli";
};
postPatch = ''
substituteInPlace setup.py --replace "flake8==2.6.0" "flake8"
'';
propagatedBuildInputs = [ pillow click dlib numpy face_recognition_models ];
# Our dlib is compiled with AVX instructions by default which breaks
# with "Illegal instruction" on some builders due to missing hardware features.
#
# As this makes the build fairly unreliable, it's better to skip the test and to ensure that
# the build is working and after each change to the package, manual testing should be done.
doCheck = false;
# Although tests are disabled by default, checkPhase still exists, so
# maintainers can check the package's functionality locally before modifying it.
checkInputs = [ flake8 pytest glibcLocales ];
checkPhase = ''
LC_ALL="en_US.UTF-8" py.test
'';
meta = with lib; {
license = licenses.mit;
homepage = "https://github.com/ageitgey/face_recognition";
maintainers = with maintainers; [ ];
description = "The world's simplest facial recognition api for Python and the command line";
};
}

View File

@ -68,6 +68,7 @@ mapAliases ({
dogpile-core = throw "dogpile-core is no longer maintained, use dogpile-cache instead"; # added 2021-11-20
eebrightbox = throw "eebrightbox is unmaintained upstream and has therefore been removed"; # added 2022-02-03
email_validator = email-validator; # added 2022-06-22
face_recognition = face-recognition; # added 2022-10-15
fake_factory = throw "fake_factory has been removed because it is unused and deprecated by upstream since 2016."; # added 2022-05-30
flask_sqlalchemy = flask-sqlalchemy; # added 2022-07-20
flask_testing = flask-testing; # added 2022-04-25

View File

@ -3217,7 +3217,7 @@ in {
facedancer = callPackage ../development/python-modules/facedancer { };
face_recognition = callPackage ../development/python-modules/face_recognition { };
face-recognition = callPackage ../development/python-modules/face-recognition { };
face_recognition_models = callPackage ../development/python-modules/face_recognition_models { };