mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-25 00:12:56 +00:00
75edda4ded
Diff: https://github.com/stefanfoulis/django-phonenumber-field/compare/refs/tags/7.3.0...8.0.0 Changelog: https://github.com/stefanfoulis/django-phonenumber-field/releases/tag/8.0.0
61 lines
1.5 KiB
Nix
61 lines
1.5 KiB
Nix
{
|
|
lib,
|
|
babel,
|
|
buildPythonPackage,
|
|
django,
|
|
djangorestframework,
|
|
fetchFromGitHub,
|
|
phonenumbers,
|
|
phonenumberslite,
|
|
python,
|
|
pythonOlder,
|
|
setuptools-scm,
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "django-phonenumber-field";
|
|
version = "8.0.0";
|
|
pyproject = true;
|
|
|
|
disabled = pythonOlder "3.8";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "stefanfoulis";
|
|
repo = "django-phonenumber-field";
|
|
rev = "refs/tags/${version}";
|
|
hash = "sha256-l+BAh7QYGN0AgDHICvlQnBYAcpEn8acu+JBmoo85kF0=";
|
|
};
|
|
|
|
build-system = [ setuptools-scm ];
|
|
|
|
# Upstream doesn't put phonenumbers in dependencies but the package doesn't
|
|
# make sense without either of the two optional dependencies. Since, in
|
|
# Nixpkgs, phonenumberslite depends on phonenumbers, add the latter
|
|
# unconditionally.
|
|
dependencies = [ django ] ++ optional-dependencies.phonenumbers;
|
|
|
|
nativeCheckInputs = [
|
|
babel
|
|
djangorestframework
|
|
];
|
|
|
|
pythonImportsCheck = [ "phonenumber_field" ];
|
|
|
|
checkPhase = ''
|
|
${python.interpreter} -m django test --settings tests.settings
|
|
'';
|
|
|
|
optional-dependencies = {
|
|
phonenumbers = [ phonenumbers ];
|
|
phonenumberslite = [ phonenumberslite ];
|
|
};
|
|
|
|
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 ];
|
|
};
|
|
}
|