biome: 1.9.2 -> 1.9.3 (#349335)
[NixPkgs.git] / pkgs / development / python-modules / ormar / default.nix
blobbb65573eee640131d10cecfbd7346bca63ec3968
2   lib,
3   aiomysql,
4   aiopg,
5   aiosqlite,
6   asyncpg,
7   buildPythonPackage,
8   cryptography,
9   databases,
10   fastapi,
11   fetchFromGitHub,
12   httpx,
13   importlib-metadata,
14   mysqlclient,
15   nest-asyncio,
16   orjson,
17   poetry-core,
18   psycopg2,
19   pydantic,
20   pymysql,
21   pytest-asyncio,
22   pytestCheckHook,
23   pythonOlder,
24   sqlalchemy,
25   typing-extensions,
28 buildPythonPackage rec {
29   pname = "ormar";
30   version = "0.20.1";
31   format = "pyproject";
33   disabled = pythonOlder "3.7";
35   src = fetchFromGitHub {
36     owner = "collerek";
37     repo = pname;
38     rev = "refs/tags/${version}";
39     hash = "sha256-DzvmJpWJANIoc5lvWAD0b2bhbKdDEpNL2l3TqXSZSnc=";
40   };
42   pythonRelaxDeps = [
43     "databases"
44     "pydantic"
45     "SQLAlchemy"
46   ];
48   nativeBuildInputs = [
49     poetry-core
50   ];
52   propagatedBuildInputs =
53     [
54       databases
55       psycopg2
56       pydantic
57       sqlalchemy
58       psycopg2
59     ]
60     ++ lib.optionals (pythonOlder "3.8") [
61       typing-extensions
62       importlib-metadata
63     ];
65   optional-dependencies = {
66     postgresql = [ asyncpg ];
67     postgres = [ asyncpg ];
68     aiopg = [ aiopg ];
69     mysql = [ aiomysql ];
70     sqlite = [ aiosqlite ];
71     orjson = [ orjson ];
72     crypto = [ cryptography ];
73     all = [
74       aiomysql
75       aiopg
76       aiosqlite
77       asyncpg
78       cryptography
79       mysqlclient
80       orjson
81       pymysql
82     ];
83   };
85   nativeCheckInputs = [ pytestCheckHook ];
87   checkInputs = [
88     fastapi
89     httpx
90     nest-asyncio
91     pytest-asyncio
92   ] ++ optional-dependencies.all;
94   disabledTestPaths = [ "benchmarks/test_benchmark_*.py" ];
96   disabledTests = [
97     # TypeError: Object of type bytes is not JSON serializable
98     "test_bulk_operations_with_json"
99     "test_all_endpoints"
100     # Tests require a database
101     "test_model_multiple_instances_of_same_table_in_schema"
102     "test_load_all_multiple_instances_of_same_table_in_schema"
103     "test_filter_groups_with_instances_of_same_table_in_schema"
104     "test_model_multiple_instances_of_same_table_in_schema"
105     "test_right_tables_join"
106     "test_multiple_reverse_related_objects"
107     "test_related_with_defaults"
108     "test_model_creation"
109     "test_default_orders_is_applied_on_related_two_fields"
110     "test_default_orders_is_applied_from_relation"
111     "test_sum_method"
112     "test_count_method "
113     "test_queryset_methods"
114     "test_queryset_update"
115     "test_selecting_subset"
116     "test_selecting_subset_of_through_model"
117     "test_simple_queryset_values"
118     "test_queryset_values_nested_relation"
119     "test_queryset_simple_values_list"
120     "test_queryset_nested_relation_values_list"
121     "test_queryset_nested_relation_subset_of_fields_values_list"
122     "test_m2m_values"
123     "test_nested_m2m"
124     "test_nested_flatten_and_exception"
125     "test_queryset_values_multiple_select_related"
126     "test_querysetproxy_values"
127     "test_querysetproxy_values_list"
128     "test_reverse_many_to_many_cascade"
129     "test_not_saved_raises_error"
130     "test_not_existing_raises_error"
131     "test_assigning_related_objects"
132     "test_quering_of_the_m2m_models"
133     "test_removal_of_the_relations"
134     "test_selecting_related"
135     "test_adding_unsaved_related"
136     "test_removing_unsaved_related"
137     "test_quering_of_related_model_works_but_no_result"
138   ];
140   pythonImportsCheck = [ "ormar" ];
142   meta = with lib; {
143     description = "Async ORM with fastapi in mind and pydantic validation";
144     homepage = "https://github.com/collerek/ormar";
145     changelog = "https://github.com/collerek/ormar/releases/tag/${version}";
146     license = licenses.mit;
147     maintainers = with maintainers; [ andreasfelix ];
148   };