depot/third_party/nixpkgs/pkgs/development/python-modules/django-otp/default.nix
Default email 587713944a Project import generated by Copybara.
GitOrigin-RevId: 6143fc5eeb9c4f00163267708e26191d1e918932
2024-04-21 17:54:59 +02:00

65 lines
1.2 KiB
Nix

{ lib
, buildPythonPackage
, fetchFromGitHub
, hatchling
, django
, freezegun
, qrcode
, pytest
, python
}:
buildPythonPackage rec {
pname = "django-otp";
version = "1.3.0post1";
pyproject = true;
src = fetchFromGitHub {
owner = "django-otp";
repo = "django-otp";
rev = "v${version}";
hash = "sha256-Q8YTCYERyoAXenSiDabxuxaWiD6ZeJKKKgaR/Rg3y20=";
};
build-system = [
hatchling
];
dependencies = [
django
qrcode
];
env.DJANGO_SETTINGS_MODUOLE = "test.test_project.settings";
nativeCheckInputs = [
freezegun
pytest
];
checkPhase = ''
runHook preCheck
export PYTHONPATH=$PYTHONPATH:test
export DJANGO_SETTINGS_MODULE=test_project.settings
${python.interpreter} -m django test django_otp
runHook postCheck
'';
pytestFlagsArray = [
"src/django_otp/test.py"
];
pythonImportsCheck = [
"django_otp"
];
meta = with lib; {
homepage = "https://github.com/django-otp/django-otp";
changelog = "https://github.com/django-otp/django-otp/blob/${src.rev}/CHANGES.rst";
description = "Pluggable framework for adding two-factor authentication to Django using one-time passwords";
license = licenses.bsd2;
maintainers = with maintainers; [ ];
};
}