summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/piccolo/default.nix
blob: 7e803cc6d87a811410e94c6d5644c2aa7c7a1bfd (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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
{
  lib,
  aiosqlite,
  asyncpg,
  black,
  buildPythonPackage,
  colorama,
  email-validator,
  fetchFromGitHub,
  httpx,
  inflection,
  jinja2,
  orjson,
  postgresql,
  postgresqlTestHook,
  pydantic,
  pytestCheckHook,
  python-dateutil,
  setuptools,
  targ,
  typing-extensions,
}:

buildPythonPackage rec {
  pname = "piccolo";
  version = "1.30.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "piccolo-orm";
    repo = "piccolo";
    tag = version;
    hash = "sha256-CR6zdaWFwhCGQsSxxUU9f3+A3RcuksG0+EUN2IotovA=";
  };

  build-system = [ setuptools ];

  dependencies = [
    black
    colorama
    inflection
    jinja2
    pydantic
    targ
    typing-extensions
  ];

  optional-dependencies = {
    orjson = [ orjson ];
    postgres = [ asyncpg ];
    sqlite = [ aiosqlite ];
  };

  nativeCheckInputs = [
    email-validator
    httpx
    postgresql
    postgresqlTestHook
    pytestCheckHook
    python-dateutil
  ]
  ++ lib.concatAttrValues optional-dependencies;

  pythonImportsCheck = [ "piccolo" ];

  disabledTests = [
    # Timing issues
    "TestMigrations"
    "TestForwardsBackwards"
    "TestMigrationManager"
    "TestTableStorage"
    "TestGraph"
    "TestDumpLoad"
    "test_add_column"
    "test_altering_table_in_schema"
    "test_auto_all"
    "test_auto"
    "test_clean"
    "test_column_name_correct"
    "test_create_table"
    "test_get_table_classes"
    "test_integer_to_bigint"
    "test_integer_to_varchar"
    "test_lazy_reference_to_app"
    "test_lazy_table_reference"
    "test_new"
    "test_on_conflict"
    "test_psql"
    "test_run"
    "test_set_digits"
    "test_set_length"
    "test_set_null"
    "test_shared"
    "test_show_all"
    "test_warn_if_are_conflicting_objects"
    "test_warn_if_is_conflicting"
  ];

  meta = {
    description = "ORM and query builder which supports asyncio";
    homepage = "https://github.com/piccolo-orm/piccolo";
    changelog = "https://github.com/piccolo-orm/piccolo/blob/${src.tag}/CHANGES.rst";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ fab ];
  };
}