Unverified Commit 22d61657 authored by Ivan Mincik's avatar Ivan Mincik Committed by GitHub
Browse files

umap: init at 3.4.0 (#413335)

parents 90830007 2149335e
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -15089,6 +15089,12 @@
    github = "lorenz";
    githubId = 5228892;
  };
  LorenzBischof = {
    name = "Lorenz Bischof";
    email = "nix@lorenzbischof.ch";
    github = "LorenzBischof";
    githubId = 1837725;
  };
  lorenzleutgeb = {
    email = "lorenz@leutgeb.xyz";
    github = "lorenzleutgeb";
+142 −0
Original line number Diff line number Diff line
{
  lib,
  python3,
  fetchFromGitHub,
  writeShellScript,
  makeWrapper,
  umap,
  postgresql,
  postgresqlTestHook,
  playwright-driver,
}:
let
  python = python3.override {
    self = python;
    packageOverrides = final: prev: {
      django = prev.django_5.override { withGdal = true; };
    };
  };
in
python.pkgs.buildPythonApplication rec {
  pname = "umap";
  version = "3.4.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "umap-project";
    repo = "umap";
    rev = version;
    hash = "sha256-7nOBcRj2b1UaGSFEslcMt04iJmKKwFQh8eP6aeeoQ7Y=";
  };

  build-system = [
    python3.pkgs.hatchling
  ];

  dependencies =
    with python.pkgs;
    [
      django
      django-agnocomplete
      django-environ
      django-probes
      django-storages
      pillow
      psycopg
      pydantic
      pydantic-core
      rcssmin
      redis
      requests
      rjsmin
      six
      social-auth-app-django
      social-auth-core
      websockets
      uvicorn
    ]
    ++ django-storages.optional-dependencies.s3;

  pythonRelaxDeps = [
    "django"
    "requests"
    "social-auth-core"
    "social-auth-app-django"
    "psycopg"
    "rcssmin"
    "rjsmin"
    "pillow"
  ];

  passthru = {
    pythonPath = "${umap}/${python.sitePackages}:${python.pkgs.makePythonPath dependencies}";
  };

  nativeBuildInputs = [
    makeWrapper
  ];

  postInstall =
    let
      start_script = writeShellScript "umap-serve" ''
        ${lib.getExe python3.pkgs.uvicorn} "$@" umap.asgi:application;
      '';
    in
    ''
      makeWrapper ${start_script} $out/bin/umap-serve \
        --prefix PYTHONPATH : "$out/${python.sitePackages}" \
        --prefix PYTHONPATH : "${python.pkgs.makePythonPath dependencies}";
    '';

  nativeCheckInputs =
    with python.pkgs;
    [
      pytest
      pytest-django
      pytest-playwright
      pytest-xdist
      pytest-rerunfailures
      moto
      factory-boy
      daphne
      pytestCheckHook
    ]
    ++ [
      (postgresql.withPackages (p: [ p.postgis ]))
      postgresqlTestHook
    ];

  preCheck = ''
    export UMAP_SETTINGS=umap/tests/settings.py
    export PLAYWRIGHT_BROWSERS_PATH=${playwright-driver.browsers}
    export DATABASE_URL="" # Defaults to localhost:5432 instead of respecting PGHOST
    export postgresqlTestUserOptions="LOGIN SUPERUSER" # Allow creation of databases
  '';

  disabledTestPaths = [
    # TODO: fix the failing tests
    "umap/tests/integration"
  ];

  disabledTests = [
    # The proxy_request tests require network
    "proxy_request_with"
    "test_good_request_passes"
    "test_valid_proxy_request"
  ];

  meta = {
    description = "UMap lets you create maps with OpenStreetMap layers in a minute and embed them in your site";
    homepage = "https://github.com/umap-project/umap/";
    license = lib.licenses.agpl3Only;
    maintainers = with lib.maintainers; [
      LorenzBischof
      jcollie
    ];
    teams = with lib.teams; [
      geospatial
      ngi
    ];
    mainProgram = "umap";
  };
}
+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
    ];
  };
}
+45 −0
Original line number Diff line number Diff line
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  setuptools,
  wheel,
  pytestCheckHook,
  pytest-django,
}:
buildPythonPackage rec {
  pname = "django-probes";
  version = "1.7.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "painless-software";
    repo = "django-probes";
    rev = version;
    hash = "sha256-n3GI7fNxZkR0ZrI843q0EjkSfSK4LpUox09FFpigJY8=";
  };

  build-system = [
    setuptools
    wheel
  ];

  pythonImportsCheck = [
    "django_probes"
  ];

  nativeCheckInputs = [
    pytestCheckHook
    pytest-django
  ];

  meta = {
    description = "Django app to run database liveness probe in a Kubernetes project";
    homepage = "https://github.com/painless-software/django-probes";
    license = lib.licenses.bsd3;
    maintainers = with lib.maintainers; [
      LorenzBischof
      jcollie
    ];
  };
}
+4 −0
Original line number Diff line number Diff line
@@ -3897,6 +3897,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 { };
@@ -4135,6 +4137,8 @@ self: super: with self; {
    callPackage ../development/python-modules/django-postgresql-netfields
      { };
  django-probes = callPackage ../development/python-modules/django-probes { };
  django-prometheus = callPackage ../development/python-modules/django-prometheus { };
  django-pwa = callPackage ../development/python-modules/django-pwa { };