diff --git a/pkgs/development/python-modules/django-pattern-library/default.nix b/pkgs/development/python-modules/django-pattern-library/default.nix index 00b6fe9c978f..76d376d11c09 100644 --- a/pkgs/development/python-modules/django-pattern-library/default.nix +++ b/pkgs/development/python-modules/django-pattern-library/default.nix @@ -1,47 +1,59 @@ -{ beautifulsoup4 -, buildPythonPackage -, django +{ buildPythonPackage , fetchFromGitHub +, fetchpatch , lib -, markdown + +# build-system , poetry-core -, python + +# dependencies +, django +, markdown , pyyaml + +# tests +, beautifulsoup4 +, pytestCheckHook +, pytest-django }: buildPythonPackage rec { pname = "django-pattern-library"; - version = "1.0.0"; + version = "1.0.1"; format = "pyproject"; src = fetchFromGitHub { - repo = pname; owner = "torchbox"; + repo = "django-pattern-library"; rev = "v${version}"; - sha256 = "sha256-V299HpbfNLa9cpVhBfzD41oe95xqh+ktQVMMVvm5Xao="; + hash = "sha256-Q8rv7RDlstTSlwmbmHV0vrnCV/lwz6VJf27BUllA34Y="; }; + patches = [ + (fetchpatch { + # https://github.com/torchbox/django-pattern-library/pull/232 + url = "https://github.com/torchbox/django-pattern-library/commit/e7a9a8928a885941391fb584eba81578a292ee7d.patch"; + hash = "sha256-3uUoxdVYEiF+to88qZRhOkh1++RfmsqCzO9JNMDqz6g="; + }) + ]; + + nativeBuildInputs = [ + poetry-core + ]; + propagatedBuildInputs = [ django pyyaml markdown ]; - postPatch = '' - substituteInPlace pyproject.toml \ - --replace poetry.masonry.api poetry.core.masonry.api - ''; - - nativeBuildInputs = [ poetry-core ]; - - checkInputs = [ + nativeCheckInputs = [ beautifulsoup4 + pytestCheckHook + pytest-django ]; - checkPhase = '' - export DJANGO_SETTINGS_MODULE=tests.settings.dev - ${python.interpreter} -m django test - ''; + env.DJANGO_SETTINGS_MODULE = "tests.settings.dev"; pythonImportsCheck = [ "pattern_library" ]; @@ -51,7 +63,5 @@ buildPythonPackage rec { changelog = "https://github.com/torchbox/django-pattern-library/blob/v${version}/CHANGELOG.md"; license = licenses.bsd3; maintainers = with maintainers; [ sephi ]; - # https://github.com/torchbox/django-pattern-library/issues/212 - broken = lib.versionAtLeast django.version "4.2"; }; }