2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
babel,
|
|
|
|
buildPythonPackage,
|
|
|
|
django,
|
|
|
|
djangorestframework,
|
|
|
|
fetchPypi,
|
|
|
|
phonenumbers,
|
|
|
|
python,
|
|
|
|
pythonOlder,
|
|
|
|
setuptools-scm,
|
2023-01-11 07:51:40 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "django-phonenumber-field";
|
2024-01-13 08:15:51 +00:00
|
|
|
version = "7.3.0";
|
2023-01-11 07:51:40 +00:00
|
|
|
format = "pyproject";
|
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
disabled = pythonOlder "3.8";
|
2023-01-11 07:51:40 +00:00
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
|
|
|
hash = "sha256-+c2z3ghfmcJJMoKTo7k9Tl+kQMDI47mesND1R0hil5c=";
|
2023-01-11 07:51:40 +00:00
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeBuildInputs = [ setuptools-scm ];
|
2023-01-11 07:51:40 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
propagatedBuildInputs = [ django ] ++ passthru.optional-dependencies.phonenumbers;
|
2023-01-11 07:51:40 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2023-04-12 12:48:02 +00:00
|
|
|
babel
|
2023-01-11 07:51:40 +00:00
|
|
|
djangorestframework
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "phonenumber_field" ];
|
2023-01-11 07:51:40 +00:00
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
${python.interpreter} -m django test --settings tests.settings
|
|
|
|
'';
|
|
|
|
|
2023-04-12 12:48:02 +00:00
|
|
|
passthru.optional-dependencies = {
|
|
|
|
phonenumbers = [ phonenumbers ];
|
|
|
|
};
|
|
|
|
|
2023-01-11 07:51:40 +00:00
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Django model and form field for normalised phone numbers using python-phonenumbers";
|
2023-01-11 07:51:40 +00:00
|
|
|
homepage = "https://github.com/stefanfoulis/django-phonenumber-field/";
|
|
|
|
changelog = "https://github.com/stefanfoulis/django-phonenumber-field/releases/tag/${version}";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ sephi ];
|
|
|
|
};
|
|
|
|
}
|