Unverified Commit e0769694 authored by Gaétan Lepage's avatar Gaétan Lepage Committed by GitHub
Browse files

python312Packages.wagtail[-modeladmin]: fix (#399723)

parents 94769ea8 b530147d
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -3,7 +3,6 @@
  buildPythonPackage,
  fetchFromGitHub,
  django,
  pythonOlder,
  setuptools,
  typing-extensions,
}:
@@ -13,8 +12,6 @@ buildPythonPackage rec {
  version = "2.3.0";
  pyproject = true;

  disabled = pythonOlder "3.9";

  src = fetchFromGitHub {
    owner = "jazzband";
    repo = "dj-database-url";
@@ -34,11 +31,11 @@ buildPythonPackage rec {

  pythonImportsCheck = [ "dj_database_url" ];

  meta = with lib; {
  meta = {
    description = "Use Database URLs in your Django Application";
    homepage = "https://github.com/jazzband/dj-database-url";
    changelog = "https://github.com/jazzband/dj-database-url/blob/v${version}/CHANGELOG.md";
    license = licenses.bsd2;
    license = lib.licenses.bsd2;
    maintainers = [ ];
  };
}
+68 −0
Original line number Diff line number Diff line
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  setuptools,
  django,
  django-stubs-ext,
  typing-extensions,
  mysqlclient,
  psycopg,
  dj-database-url,
  python,
}:

buildPythonPackage rec {
  pname = "django-tasks";
  version = "0.6.1";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "RealOrangeOne";
    repo = "django-tasks";
    tag = version;
    hash = "sha256-MLztM4jVQV2tHPcIExbPGX+hCHSTqaQJeTbQqaVA3V4=";
  };

  build-system = [
    setuptools
  ];

  dependencies = [
    django
    django-stubs-ext
    typing-extensions
  ];

  optional-dependencies = {
    mysql = [
      mysqlclient
    ];
    postgres = [
      psycopg
    ];
  };

  pythonImportsCheck = [ "django_tasks" ];

  nativeCheckInputs = [
    dj-database-url
  ];

  checkPhase = ''
    runHook preCheck

    export DJANGO_SETTINGS_MODULE="tests.settings"
    ${python.interpreter} -m manage test --noinput

    runHook postCheck
  '';

  meta = {
    description = "Reference implementation and backport of background workers and tasks in Django";
    homepage = "https://github.com/RealOrangeOne/django-tasks";
    changelog = "https://github.com/RealOrangeOne/django-tasks/releases/tag/${version}";
    license = lib.licenses.bsd3;
    maintainers = with lib.maintainers; [ GaetanLepage ];
  };
}
+24 −11
Original line number Diff line number Diff line
{
  lib,
  buildPythonPackage,
  dj-database-url,
  fetchFromGitHub,
  flit-core,
  python,
  pythonOlder,
  wagtail,
  dj-database-url,
  python,
}:

buildPythonPackage rec {
@@ -14,18 +13,30 @@ buildPythonPackage rec {
  version = "2.1.0";
  pyproject = true;

  disabled = pythonOlder "3.8";

  src = fetchFromGitHub {
    repo = pname;
    owner = "wagtail-nest";
    repo = "wagtail-modeladmin";
    tag = "v${version}";
    hash = "sha256-IG7e7YomMM7K2IlJ1Dr1zo+blDPHnu/JeS5csos8ncc=";
  };

  nativeBuildInputs = [ flit-core ];
  # Fail with `AssertionError`
  # AssertionError: <Warning: level=30,... > not found in [<Warning: ...>]
  postPatch = ''
    substituteInPlace wagtail_modeladmin/test/tests/test_simple_modeladmin.py \
      --replace-fail \
        "def test_model_with_single_tabbed_panel_only(" \
        "def no_test_model_with_single_tabbed_panel_only(" \
      --replace-fail \
        "def test_model_with_two_tabbed_panels_only(" \
        "def no_test_model_with_two_tabbed_panels_only("
  '';

  build-system = [ flit-core ];

  propagatedBuildInputs = [ wagtail ];
  dependencies = [
    wagtail
  ];

  nativeCheckInputs = [ dj-database-url ];

@@ -33,15 +44,17 @@ buildPythonPackage rec {

  checkPhase = ''
    runHook preCheck

    ${python.interpreter} testmanage.py test

    runHook postCheck
  '';

  meta = with lib; {
  meta = {
    description = "Add any model in your project to the Wagtail admin. Formerly wagtail.contrib.modeladmin";
    homepage = "https://github.com/wagtail-nest/wagtail-modeladmin";
    changelog = "https://github.com/wagtail/wagtail-modeladmin/blob/v${version}/CHANGELOG.md";
    license = licenses.bsd3;
    maintainers = with maintainers; [ sephi ];
    license = lib.licenses.bsd3;
    maintainers = with lib.maintainers; [ sephi ];
  };
}
+26 −23
Original line number Diff line number Diff line
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,

  # build-system
  setuptools,

  # dependencies
  anyascii,
  beautifulsoup4,
  buildPythonPackage,
  callPackage,
  django,
  django-filter,
  django-modelcluster,
  django-taggit,
  django-tasks,
  django-treebeard,
  djangorestframework,
  draftjs-exporter,
  fetchPypi,
  html5lib,
  l18n,
  laces,
  openpyxl,
  permissionedforms,
  pillow,
  pythonOlder,
  requests,
  telepath,
  willow,

  # tests
  callPackage,
}:

buildPythonPackage rec {
  pname = "wagtail";
  version = "6.4.1";
  format = "setuptools";

  disabled = pythonOlder "3.8";
  pyproject = true;

  src = fetchPypi {
    inherit pname version;
    hash = "sha256-zsPm1JIKbRePoetvSvgLNw/dVXDtkkuXkQThV/EMoJc=";
  src = fetchFromGitHub {
    owner = "wagtail";
    repo = "wagtail";
    tag = "v${version}";
    hash = "sha256-2qixbJK3f+3SBnsfVEcObFJmuBvE2J9o3LIkILZQRLQ=";
  };

  postPatch = ''
    substituteInPlace setup.py \
      --replace "django-filter>=23.3,<24" "django-filter>=23.3,<24.3"
  '';
  build-system = [
    setuptools
  ];

  propagatedBuildInputs = [
  dependencies = [
    anyascii
    beautifulsoup4
    django
    django-treebeard
    django-filter
    django-modelcluster
    django-taggit
    django-tasks
    django-treebeard
    djangorestframework
    draftjs-exporter
    html5lib
    l18n
    laces
    openpyxl
    permissionedforms
@@ -70,12 +73,12 @@ buildPythonPackage rec {

  pythonImportsCheck = [ "wagtail" ];

  meta = with lib; {
  meta = {
    description = "Django content management system focused on flexibility and user experience";
    mainProgram = "wagtail";
    homepage = "https://github.com/wagtail/wagtail";
    changelog = "https://github.com/wagtail/wagtail/blob/v${version}/CHANGELOG.txt";
    license = licenses.bsd3;
    maintainers = with maintainers; [ sephi ];
    license = lib.licenses.bsd3;
    maintainers = with lib.maintainers; [ sephi ];
  };
}
+2 −0
Original line number Diff line number Diff line
@@ -3880,6 +3880,8 @@ self: super: with self; {
  django-taggit = callPackage ../development/python-modules/django-taggit { };
  django-tasks = callPackage ../development/python-modules/django-tasks { };
  django-tastypie = callPackage ../development/python-modules/django-tastypie { };
  django-tenants = callPackage ../development/python-modules/django-tenants { };