python311Packages.django-pattern-library: 1.0.0 -> 1.0.1

Unbreak the build, convert to pytest-django, propose upstream patch for
poetry-core migration.

https://github.com/torchbox/django-pattern-library/blob/v1.0.1/CHANGELOG.md
This commit is contained in:
Martin Weinelt 2023-09-26 17:21:55 +02:00
parent df5a13303e
commit 34deb8dd6a

View File

@ -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";
};
}