depot/third_party/nixpkgs/pkgs/development/python-modules/django-phonenumber-field/default.nix
Default email bcb2f287e1 Project import generated by Copybara.
GitOrigin-RevId: d603719ec6e294f034936c0d0dc06f689d91b6c3
2024-06-20 20:27:18 +05:30

52 lines
1.2 KiB
Nix

{
lib,
babel,
buildPythonPackage,
django,
djangorestframework,
fetchPypi,
phonenumbers,
python,
pythonOlder,
setuptools-scm,
}:
buildPythonPackage rec {
pname = "django-phonenumber-field";
version = "7.3.0";
format = "pyproject";
disabled = pythonOlder "3.8";
src = fetchPypi {
inherit pname version;
hash = "sha256-+c2z3ghfmcJJMoKTo7k9Tl+kQMDI47mesND1R0hil5c=";
};
nativeBuildInputs = [ setuptools-scm ];
propagatedBuildInputs = [ django ] ++ passthru.optional-dependencies.phonenumbers;
nativeCheckInputs = [
babel
djangorestframework
];
pythonImportsCheck = [ "phonenumber_field" ];
checkPhase = ''
${python.interpreter} -m django test --settings tests.settings
'';
passthru.optional-dependencies = {
phonenumbers = [ phonenumbers ];
};
meta = with lib; {
description = "Django model and form field for normalised phone numbers using python-phonenumbers";
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 ];
};
}