Files
nixpkgs/pkgs/development/python-modules/djangorestframework-stubs/default.nix
T
Robert Schütz 1a04744f74 treewide: remove superfluous disabled
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
2026-01-11 09:34:20 -08:00

72 lines
1.5 KiB
Nix

{
lib,
buildPythonPackage,
django-stubs,
fetchFromGitHub,
mypy,
py,
coreapi,
pytest-mypy-plugins,
pytestCheckHook,
requests,
types-pyyaml,
setuptools,
types-markdown,
types-requests,
typing-extensions,
}:
buildPythonPackage rec {
pname = "djangorestframework-stubs";
version = "3.16.2";
pyproject = true;
src = fetchFromGitHub {
owner = "typeddjango";
repo = "djangorestframework-stubs";
tag = version;
hash = "sha256-A6IyRJwuc0eqRtkCHtWN5C5yCMdgxfygqmpHV+/MJhE=";
};
postPatch = ''
substituteInPlace pyproject.toml \
--replace-fail "<79.0.0" ""
'';
build-system = [ setuptools ];
dependencies = [
django-stubs
requests
types-pyyaml
types-requests
typing-extensions
];
optional-dependencies = {
compatible-mypy = [ mypy ] ++ django-stubs.optional-dependencies.compatible-mypy;
coreapi = [ coreapi ];
markdown = [ types-markdown ];
};
nativeCheckInputs = [
py
pytest-mypy-plugins
pytestCheckHook
]
++ lib.concatAttrValues optional-dependencies;
# Upstream recommends mypy > 1.7 which we don't have yet, thus all tests are failing with 3.14.5 and below
doCheck = false;
pythonImportsCheck = [ "rest_framework-stubs" ];
meta = {
description = "PEP-484 stubs for Django REST Framework";
homepage = "https://github.com/typeddjango/djangorestframework-stubs";
changelog = "https://github.com/typeddjango/djangorestframework-stubs/releases/tag/${src.tag}";
license = lib.licenses.mit;
maintainers = [ ];
};
}