diff --git a/pkgs/development/python-modules/django-stubs/default.nix b/pkgs/development/python-modules/django-stubs/default.nix index bc7897dd6ba9..e80d281e5200 100644 --- a/pkgs/development/python-modules/django-stubs/default.nix +++ b/pkgs/development/python-modules/django-stubs/default.nix @@ -3,11 +3,12 @@ buildPythonPackage, django, django-stubs-ext, - fetchPypi, + fetchFromGitHub, mypy, + pytest-mypy-plugins, pytestCheckHook, pythonOlder, - setuptools, + hatchling, tomli, types-pytz, types-pyyaml, @@ -16,23 +17,17 @@ buildPythonPackage rec { pname = "django-stubs"; - version = "5.2.0"; + version = "5.2.2"; pyproject = true; - disabled = pythonOlder "3.8"; - - src = fetchPypi { - pname = "django_stubs"; - inherit version; - hash = "sha256-B+JcLTy/9b5UAif/N3GcyJ8hXfqqpesDinWwG7+7JyI="; + src = fetchFromGitHub { + owner = "typeddjango"; + repo = "django-stubs"; + tag = version; + hash = "sha256-kF5g0/rkMQxYTfSrTqzZ6BuqGlE42K/AVhc1/ARc+/c="; }; - postPatch = '' - substituteInPlace pyproject.toml \ - --replace-fail "setuptools<79.0.0" setuptools - ''; - - build-system = [ setuptools ]; + build-system = [ hatchling ]; dependencies = [ django @@ -48,9 +43,19 @@ buildPythonPackage rec { }; nativeCheckInputs = [ + pytest-mypy-plugins pytestCheckHook ] - ++ lib.flatten (builtins.attrValues optional-dependencies); + ++ lib.flatten (lib.attrValues optional-dependencies); + + disabledTests = [ + # AttributeError: module 'django.contrib.auth.forms' has no attribute 'SetUnusablePasswordMixin' + "test_find_classes_inheriting_from_generic" + ]; + + disabledTestPaths = [ + "tests/typecheck" + ]; pythonImportsCheck = [ "django-stubs" ];