1a04744f74
There is no need to disable Python packages for Python versions that are
no longer in Nixpkgs.
This change was generated using the following script:
pattern='^\s*disabled\s*=\s*pythonOlder\s*"3\.\([0-9]\|10\)"\s*;\s*$'
for f in $(find -name '*.nix'); do
grep -q "$pattern" "$f" || continue
sed -i "/$pattern/d" "$f"
if [ $(grep -c pythonOlder "$f") == 1 ]; then
sed -i '/^\s*pythonOlder,\s*$/d' "$f"
fi
nixfmt "$f"
done
83 lines
1.5 KiB
Nix
83 lines
1.5 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.16.0";
|
|
pyproject = true;
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "encode";
|
|
repo = "django-rest-framework";
|
|
rev = version;
|
|
hash = "sha256-LFq8mUx+jAFFnQTfysYs+DSN941p+8h9mDDOp+LO7VU=";
|
|
};
|
|
|
|
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 = {
|
|
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/";
|
|
license = lib.licenses.bsd2;
|
|
};
|
|
}
|