Unverified Commit ee9e18e9 authored by LorenzBischof's avatar LorenzBischof
Browse files

python3Packages.django-agnocomplete: init at 2.2.0

parent c072c281
Loading
Loading
Loading
Loading
+83 −0
Original line number Diff line number Diff line
{
  lib,
  django,
  buildPythonPackage,
  fetchFromGitHub,
  setuptools,
  setuptools-scm,
  requests,
  six,
  pytestCheckHook,
  pytest-cov-stub,
  pytest-django,
  mock,
  pyyaml,
}:
buildPythonPackage rec {
  pname = "django-agnocomplete";
  version = "2.2.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "peopledoc";
    repo = "django-agnocomplete";
    rev = version;
    hash = "sha256-SDuLJM/ZvROkBOSbaVi6FMDRcR5Um4UrdPSq1ZMrlXM=";
  };

  build-system = [
    setuptools
    setuptools-scm
  ];

  dependencies = [
    django
    requests
    six
  ];

  pythonImportsCheck = [
    "agnocomplete"
  ];

  nativeCheckInputs = [
    pytestCheckHook
    pytest-cov-stub
    pytest-django
    mock
    pyyaml
  ];

  postPatch = ''
    # 1. The "default.html" templates for forms and formsets will be removed.
    #    These were proxies to the equivalent "table.html" templates, but the new
    #    "div.html" templates will be the default from Django 5.0.
    #    https://docs.djangoproject.com/en/4.2/releases/4.1/
    #    https://docs.djangoproject.com/en/4.2/ref/forms/api/#as-div
    #
    # 2. assertQuerysetEqual() is deprecated in favor of assertQuerySetEqual()
    substituteInPlace demo/tests/test_fields.py \
      --replace-fail '"{}".format(form)' 'form.as_div()' \
      --replace-fail "assertQuerysetEqual" "assertQuerySetEqual"
  '';

  disabledTests = [
    # Exception message does not match for abstract class test, but the result
    # should be the same: can't instantiate abstract class
    "test_AgnocompleteBase"
    "test_AgnocompleteModel"
  ];

  __darwinAllowLocalNetworking = true;

  meta = {
    description = "front-end agnostic toolbox for autocompletion fields";
    homepage = "https://github.com/peopledoc/django-agnocomplete";
    changelog = "https://github.com/peopledoc/django-agnocomplete/blob/${src.rev}/CHANGELOG.rst";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [
      LorenzBischof
      jcollie
    ];
  };
}
+2 −0
Original line number Diff line number Diff line
@@ -3836,6 +3836,8 @@ self: super: with self; {
  django-admin-sortable2 = callPackage ../development/python-modules/django-admin-sortable2 { };
  django-agnocomplete = callPackage ../development/python-modules/django-agnocomplete { };
  django-allauth = callPackage ../development/python-modules/django-allauth { };
  django-annoying = callPackage ../development/python-modules/django-annoying { };