15 buildPythonPackage rec {
16 pname = "django-phonenumber-field";
20 disabled = pythonOlder "3.8";
22 src = fetchFromGitHub {
23 owner = "stefanfoulis";
24 repo = "django-phonenumber-field";
25 rev = "refs/tags/${version}";
26 hash = "sha256-l+BAh7QYGN0AgDHICvlQnBYAcpEn8acu+JBmoo85kF0=";
29 build-system = [ setuptools-scm ];
31 # Upstream doesn't put phonenumbers in dependencies but the package doesn't
32 # make sense without either of the two optional dependencies. Since, in
33 # Nixpkgs, phonenumberslite depends on phonenumbers, add the latter
35 dependencies = [ django ] ++ optional-dependencies.phonenumbers;
42 pythonImportsCheck = [ "phonenumber_field" ];
45 ${python.interpreter} -m django test --settings tests.settings
48 optional-dependencies = {
49 phonenumbers = [ phonenumbers ];
50 phonenumberslite = [ phonenumberslite ];
54 description = "Django model and form field for normalised phone numbers using python-phonenumbers";
55 homepage = "https://github.com/stefanfoulis/django-phonenumber-field/";
56 changelog = "https://github.com/stefanfoulis/django-phonenumber-field/releases/tag/${version}";
57 license = licenses.mit;
58 maintainers = with maintainers; [ sephi ];