summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/django-sql-utils/default.nix
blob: e7da7d94593158077a3d4b75f7d8e836ddf2ec25 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  hatchling,
  django,
  sqlparse,
  pytestCheckHook,
  pytest-django,
}:

buildPythonPackage rec {
  pname = "django-sql-utils";
  version = "0.7.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "martsberger";
    repo = "django-sql-utils";
    tag = version;
    hash = "sha256-OjKPxoWYheu8UQ14KvyiQyHISAQjJep+N4HRc4Msa1w=";
  };

  postPatch = ''
    echo -e "\n[tool.hatch.build.targets.wheel]\npackages = [ \"sql_util\" ]" >> pyproject.toml
  '';

  build-system = [ hatchling ];

  dependencies = [
    django
    sqlparse
  ];

  env = {
    DJANGO_SETTINGS_MODULE = "sql_util.tests.test_sqlite_settings";
  };

  nativeCheckInputs = [
    pytestCheckHook
    pytest-django
  ];

  pythonImportsCheck = [ "sql_util" ];

  meta = {
    description = "SQL utilities for Django";
    homepage = "https://github.com/martsberger/django-sql-utils";
    changelog = "https://github.com/martsberger/django-sql-utils/releases/tag/${version}";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ defelo ];
  };
}