2024-05-15 15:35:15 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
django,
|
|
|
|
django-allauth,
|
|
|
|
djangorestframework,
|
|
|
|
djangorestframework-simplejwt,
|
|
|
|
fetchFromGitHub,
|
|
|
|
python,
|
|
|
|
pythonOlder,
|
|
|
|
responses,
|
|
|
|
setuptools,
|
|
|
|
unittest-xml-reporting,
|
2022-06-16 17:23:12 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "dj-rest-auth";
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "6.0.0";
|
2024-01-13 08:15:51 +00:00
|
|
|
pyproject = true;
|
2022-06-16 17:23:12 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
disabled = pythonOlder "3.8";
|
2024-01-25 14:12:00 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "iMerica";
|
|
|
|
repo = "dj-rest-auth";
|
2023-03-15 16:39:30 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2024-05-15 15:35:15 +00:00
|
|
|
hash = "sha256-fNy1uN3oH54Wd9+EqYpiV0ot1MbSSC7TZoAARQeR81s=";
|
2022-06-16 17:23:12 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py \
|
2024-05-15 15:35:15 +00:00
|
|
|
--replace-fail "==" ">="
|
|
|
|
substituteInPlace dj_rest_auth/tests/test_api.py \
|
|
|
|
--replace-fail "assertEquals" "assertEqual"
|
2022-06-16 17:23:12 +00:00
|
|
|
'';
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
build-system = [ setuptools ];
|
2024-01-13 08:15:51 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
buildInputs = [ django ];
|
2023-03-15 16:39:30 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
dependencies = [ djangorestframework ];
|
2022-06-16 17:23:12 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
passthru.optional-dependencies.with_social = [ django-allauth ];
|
2023-03-15 16:39:30 +00:00
|
|
|
|
|
|
|
nativeCheckInputs = [
|
2022-06-16 17:23:12 +00:00
|
|
|
djangorestframework-simplejwt
|
|
|
|
responses
|
|
|
|
unittest-xml-reporting
|
2023-03-15 16:39:30 +00:00
|
|
|
] ++ passthru.optional-dependencies.with_social;
|
|
|
|
|
|
|
|
preCheck = ''
|
2024-01-25 14:12:00 +00:00
|
|
|
# Test connects to graph.facebook.com
|
2023-03-15 16:39:30 +00:00
|
|
|
substituteInPlace dj_rest_auth/tests/test_serializers.py \
|
2024-05-15 15:35:15 +00:00
|
|
|
--replace-fail "def test_http_error" "def dont_test_http_error"
|
2023-03-15 16:39:30 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
runHook preCheck
|
|
|
|
${python.interpreter} runtests.py
|
|
|
|
runHook postCheck
|
|
|
|
'';
|
2022-06-16 17:23:12 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
pythonImportsCheck = [ "dj_rest_auth" ];
|
2022-06-16 17:23:12 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Authentication for Django Rest Framework";
|
|
|
|
homepage = "https://github.com/iMerica/dj-rest-auth";
|
2024-01-25 14:12:00 +00:00
|
|
|
changelog = "https://github.com/iMerica/dj-rest-auth/releases/tag/${version}";
|
2022-06-16 17:23:12 +00:00
|
|
|
license = licenses.mit;
|
2023-08-04 22:07:22 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2022-06-16 17:23:12 +00:00
|
|
|
};
|
|
|
|
}
|