Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ 2 lib, 3 buildPythonPackage, 4 fetchFromGitHub, 5 pythonOlder, 6 7 # build-system 8 setuptools, 9 10 # dependencies 11 django, 12 pytz, 13 14 # optional-dependencies 15 coreapi, 16 coreschema, 17 django-guardian, 18 inflection, 19 psycopg2, 20 pygments, 21 pyyaml, 22 23 # tests 24 pytestCheckHook, 25 pytest-django, 26}: 27 28buildPythonPackage rec { 29 pname = "djangorestframework"; 30 version = "3.15.2"; 31 pyproject = true; 32 disabled = pythonOlder "3.6"; 33 34 src = fetchFromGitHub { 35 owner = "encode"; 36 repo = "django-rest-framework"; 37 rev = version; 38 hash = "sha256-ne0sk4m11Ha77tNmCsdhj7QVmCkYj5GjLn/dLF4qxU8="; 39 }; 40 41 build-system = [ setuptools ]; 42 43 dependencies = [ 44 django 45 pygments 46 ] ++ (lib.optional (lib.versionOlder django.version "5.0.0") pytz); 47 48 optional-dependencies = { 49 complete = [ 50 coreapi 51 coreschema 52 django-guardian 53 inflection 54 psycopg2 55 pygments 56 pyyaml 57 ]; 58 }; 59 60 nativeCheckInputs = [ 61 pytest-django 62 pytestCheckHook 63 ] ++ optional-dependencies.complete; 64 65 disabledTests = [ 66 # https://github.com/encode/django-rest-framework/issues/9422 67 "test_urlpatterns" 68 ]; 69 70 pythonImportsCheck = [ "rest_framework" ]; 71 72 meta = with lib; { 73 changelog = "https://github.com/encode/django-rest-framework/releases/tag/3.15.1"; 74 description = "Web APIs for Django, made easy"; 75 homepage = "https://www.django-rest-framework.org/"; 76 maintainers = with maintainers; [ desiderius ]; 77 license = licenses.bsd2; 78 }; 79}