1{
2 lib,
3 aiosqlite,
4 asyncpg,
5 black,
6 buildPythonPackage,
7 colorama,
8 email-validator,
9 fetchFromGitHub,
10 httpx,
11 inflection,
12 jinja2,
13 orjson,
14 postgresql,
15 postgresqlTestHook,
16 pydantic,
17 pytestCheckHook,
18 python-dateutil,
19 setuptools,
20 targ,
21 typing-extensions,
22}:
23
24buildPythonPackage rec {
25 pname = "piccolo";
26 version = "1.28.0";
27 pyproject = true;
28
29 src = fetchFromGitHub {
30 owner = "piccolo-orm";
31 repo = "piccolo";
32 tag = version;
33 hash = "sha256-5VzcMLPf12E+IEOaTUrxHl0W9r7NPUY542qOanrjG4w=";
34 };
35
36 build-system = [ setuptools ];
37
38 dependencies = [
39 black
40 colorama
41 inflection
42 jinja2
43 pydantic
44 targ
45 typing-extensions
46 ];
47
48 optional-dependencies = {
49 orjson = [ orjson ];
50 postgres = [ asyncpg ];
51 sqlite = [ aiosqlite ];
52 };
53
54 nativeCheckInputs = [
55 email-validator
56 httpx
57 postgresql
58 postgresqlTestHook
59 pytestCheckHook
60 python-dateutil
61 ]
62 ++ lib.flatten (builtins.attrValues optional-dependencies);
63
64 pythonImportsCheck = [ "piccolo" ];
65
66 disabledTests = [
67 # Timing issues
68 "TestMigrations"
69 "TestForwardsBackwards"
70 "TestMigrationManager"
71 "TestTableStorage"
72 "TestGraph"
73 "TestDumpLoad"
74 "test_add_column"
75 "test_altering_table_in_schema"
76 "test_auto_all"
77 "test_auto"
78 "test_clean"
79 "test_column_name_correct"
80 "test_create_table"
81 "test_get_table_classes"
82 "test_integer_to_bigint"
83 "test_integer_to_varchar"
84 "test_lazy_reference_to_app"
85 "test_lazy_table_reference"
86 "test_new"
87 "test_on_conflict"
88 "test_psql"
89 "test_run"
90 "test_set_digits"
91 "test_set_length"
92 "test_set_null"
93 "test_shared"
94 "test_show_all"
95 "test_warn_if_are_conflicting_objects"
96 "test_warn_if_is_conflicting"
97 ];
98
99 meta = {
100 description = "ORM and query builder which supports asyncio";
101 homepage = "https://github.com/piccolo-orm/piccolo";
102 changelog = "https://github.com/piccolo-orm/piccolo/blob/${src.tag}/CHANGES.rst";
103 license = lib.licenses.mit;
104 maintainers = with lib.maintainers; [ fab ];
105 };
106}