Files
nixpkgs/pkgs/development/python-modules/djangorestframework/default.nix
T
Winter a19cd4ffb1 Revert "treewide: replace rev with tag"
This reverts commit 65a333600d.

This wasn't tested for correctness with something like fodwatch [0],
and should not have been (self-)merged so quickly, especially without
further review.

It also resulted in the breakage of at least one package [1] (and that's
the one we know of and was caught).

A few packages that were updated in between this commit and this revert
were not reverted back to using `rev`, but other than that, this is a
1:1 revert.

[0]: https://codeberg.org/raphaelr/fodwatch
[1]: https://github.com/NixOS/nixpkgs/pull/396904 / 758551e458
2025-04-08 02:57:25 -04:00

84 lines
1.6 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
pythonOlder,
# build-system
setuptools,
# dependencies
django,
pytz,
# optional-dependencies
coreapi,
coreschema,
django-guardian,
inflection,
psycopg2,
pygments,
pyyaml,
# tests
pytestCheckHook,
pytest-django,
}:
buildPythonPackage rec {
pname = "djangorestframework";
version = "3.15.2";
pyproject = true;
disabled = pythonOlder "3.6";
src = fetchFromGitHub {
owner = "encode";
repo = "django-rest-framework";
rev = version;
hash = "sha256-ne0sk4m11Ha77tNmCsdhj7QVmCkYj5GjLn/dLF4qxU8=";
};
build-system = [ setuptools ];
dependencies = [
django
pygments
] ++ (lib.optional (lib.versionOlder django.version "5.0.0") pytz);
optional-dependencies = {
complete =
[
coreschema
django-guardian
inflection
psycopg2
pygments
pyyaml
]
++ lib.optionals (pythonOlder "3.13") [
# broken on 3.13
coreapi
];
};
nativeCheckInputs = [
pytest-django
pytestCheckHook
] ++ optional-dependencies.complete;
disabledTests = [
# https://github.com/encode/django-rest-framework/issues/9422
"test_urlpatterns"
];
pythonImportsCheck = [ "rest_framework" ];
meta = with lib; {
changelog = "https://github.com/encode/django-rest-framework/releases/tag/3.15.1";
description = "Web APIs for Django, made easy";
homepage = "https://www.django-rest-framework.org/";
maintainers = with maintainers; [ desiderius ];
license = licenses.bsd2;
};
}