1{ beautifulsoup4
2, buildPythonPackage
3, django
4, fetchFromGitHub
5, lib
6, markdown
7, poetry-core
8, python
9, pyyaml
10}:
11
12buildPythonPackage rec {
13 pname = "django-pattern-library";
14 version = "1.0.0";
15 format = "pyproject";
16
17 src = fetchFromGitHub {
18 repo = pname;
19 owner = "torchbox";
20 rev = "v${version}";
21 sha256 = "sha256-V299HpbfNLa9cpVhBfzD41oe95xqh+ktQVMMVvm5Xao=";
22 };
23
24 propagatedBuildInputs = [
25 django
26 pyyaml
27 markdown
28 ];
29
30 postPatch = ''
31 substituteInPlace pyproject.toml \
32 --replace poetry.masonry.api poetry.core.masonry.api
33 '';
34
35 nativeBuildInputs = [ poetry-core ];
36
37 checkInputs = [
38 beautifulsoup4
39 ];
40
41 checkPhase = ''
42 export DJANGO_SETTINGS_MODULE=tests.settings.dev
43 ${python.interpreter} -m django test
44 '';
45
46 pythonImportsCheck = [ "pattern_library" ];
47
48 meta = with lib; {
49 description = "UI pattern libraries for Django templates";
50 homepage = "https://github.com/torchbox/django-pattern-library/";
51 changelog = "https://github.com/torchbox/django-pattern-library/blob/v${version}/CHANGELOG.md";
52 license = licenses.bsd3;
53 maintainers = with maintainers; [ sephi ];
54 # https://github.com/torchbox/django-pattern-library/issues/212
55 broken = lib.versionAtLeast django.version "4.2";
56 };
57}