depot/third_party/nixpkgs/pkgs/development/python-modules/dj-rest-auth/default.nix
Default email 23b612e36f Project import generated by Copybara.
GitOrigin-RevId: ae5c332cbb5827f6b1f02572496b141021de335f
2024-01-25 23:12:00 +09:00

79 lines
1.6 KiB
Nix

{ lib
, buildPythonPackage
, django
, django-allauth
, djangorestframework
, djangorestframework-simplejwt
, fetchFromGitHub
, python
, pythonOlder
, responses
, setuptools
, unittest-xml-reporting
}:
buildPythonPackage rec {
pname = "dj-rest-auth";
version = "5.0.2";
pyproject = true;
disabled = pythonOlder "3.6";
src = fetchFromGitHub {
owner = "iMerica";
repo = "dj-rest-auth";
rev = "refs/tags/${version}";
hash = "sha256-TqeNpxXn+v89fEiJ4AVNhp8blCfYQKFQfYmZ6/QlRbQ=";
};
postPatch = ''
substituteInPlace setup.py \
--replace "==" ">="
'';
nativeBuildInputs = [
setuptools
];
buildInputs = [
django
];
propagatedBuildInputs = [
djangorestframework
];
passthru.optional-dependencies.with_social = [
django-allauth
];
nativeCheckInputs = [
djangorestframework-simplejwt
responses
unittest-xml-reporting
] ++ passthru.optional-dependencies.with_social;
preCheck = ''
# Test connects to graph.facebook.com
substituteInPlace dj_rest_auth/tests/test_serializers.py \
--replace "def test_http_error" "def dont_test_http_error"
'';
checkPhase = ''
runHook preCheck
${python.interpreter} runtests.py
runHook postCheck
'';
pythonImportsCheck = [
"dj_rest_auth"
];
meta = with lib; {
description = "Authentication for Django Rest Framework";
homepage = "https://github.com/iMerica/dj-rest-auth";
changelog = "https://github.com/iMerica/dj-rest-auth/releases/tag/${version}";
license = licenses.mit;
maintainers = with maintainers; [ ];
};
}