2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
aiomysql,
|
|
|
|
aiopg,
|
|
|
|
aiosqlite,
|
|
|
|
asyncpg,
|
|
|
|
buildPythonPackage,
|
|
|
|
cryptography,
|
|
|
|
databases,
|
|
|
|
fastapi,
|
|
|
|
fetchFromGitHub,
|
|
|
|
httpx,
|
|
|
|
importlib-metadata,
|
|
|
|
mysqlclient,
|
|
|
|
nest-asyncio,
|
|
|
|
orjson,
|
|
|
|
poetry-core,
|
|
|
|
psycopg2,
|
|
|
|
pydantic,
|
|
|
|
pymysql,
|
|
|
|
pytest-asyncio,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
|
|
|
pythonRelaxDepsHook,
|
|
|
|
sqlalchemy,
|
|
|
|
typing-extensions,
|
2022-01-03 16:56:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "ormar";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "0.12.2";
|
2022-01-03 16:56:52 +00:00
|
|
|
format = "pyproject";
|
2022-02-20 05:27:41 +00:00
|
|
|
|
2022-01-03 16:56:52 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
2022-02-20 05:27:41 +00:00
|
|
|
|
2022-01-03 16:56:52 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "collerek";
|
|
|
|
repo = pname;
|
2022-06-16 17:23:12 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2023-11-16 04:20:00 +00:00
|
|
|
hash = "sha256-Yd5ex0bcy61zq5Sn2dKeb98s/CMxUWnyGx6jFWQ3RUs=";
|
2022-01-03 16:56:52 +00:00
|
|
|
};
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
pythonRelaxDeps = [
|
|
|
|
"databases"
|
|
|
|
"pydantic"
|
|
|
|
"SQLAlchemy"
|
|
|
|
];
|
|
|
|
|
2022-01-03 16:56:52 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
poetry-core
|
2023-02-02 18:25:31 +00:00
|
|
|
pythonRelaxDepsHook
|
2022-01-03 16:56:52 +00:00
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
propagatedBuildInputs =
|
|
|
|
[
|
|
|
|
databases
|
|
|
|
psycopg2
|
|
|
|
pydantic
|
|
|
|
sqlalchemy
|
|
|
|
psycopg2
|
|
|
|
]
|
|
|
|
++ lib.optionals (pythonOlder "3.8") [
|
|
|
|
typing-extensions
|
|
|
|
importlib-metadata
|
|
|
|
];
|
2022-01-03 16:56:52 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
passthru.optional-dependencies = {
|
2024-06-05 15:53:02 +00:00
|
|
|
postgresql = [ asyncpg ];
|
|
|
|
postgres = [ asyncpg ];
|
|
|
|
aiopg = [ aiopg ];
|
|
|
|
mysql = [ aiomysql ];
|
|
|
|
sqlite = [ aiosqlite ];
|
|
|
|
orjson = [ orjson ];
|
|
|
|
crypto = [ cryptography ];
|
2023-02-02 18:25:31 +00:00
|
|
|
all = [
|
|
|
|
aiomysql
|
|
|
|
aiopg
|
|
|
|
aiosqlite
|
|
|
|
asyncpg
|
|
|
|
cryptography
|
|
|
|
mysqlclient
|
|
|
|
orjson
|
|
|
|
pymysql
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2023-02-02 18:25:31 +00:00
|
|
|
|
2022-01-03 16:56:52 +00:00
|
|
|
checkInputs = [
|
2022-02-20 05:27:41 +00:00
|
|
|
fastapi
|
2023-02-02 18:25:31 +00:00
|
|
|
httpx
|
|
|
|
nest-asyncio
|
2022-01-03 16:56:52 +00:00
|
|
|
pytest-asyncio
|
2023-02-02 18:25:31 +00:00
|
|
|
] ++ passthru.optional-dependencies.all;
|
2022-02-20 05:27:41 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
disabledTestPaths = [ "benchmarks/test_benchmark_*.py" ];
|
2022-02-20 05:27:41 +00:00
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# TypeError: Object of type bytes is not JSON serializable
|
|
|
|
"test_bulk_operations_with_json"
|
2023-02-02 18:25:31 +00:00
|
|
|
"test_all_endpoints"
|
2022-09-22 12:36:57 +00:00
|
|
|
# Tests require a database
|
|
|
|
"test_model_multiple_instances_of_same_table_in_schema"
|
|
|
|
"test_load_all_multiple_instances_of_same_table_in_schema"
|
|
|
|
"test_filter_groups_with_instances_of_same_table_in_schema"
|
|
|
|
"test_model_multiple_instances_of_same_table_in_schema"
|
|
|
|
"test_right_tables_join"
|
|
|
|
"test_multiple_reverse_related_objects"
|
|
|
|
"test_related_with_defaults"
|
|
|
|
"test_model_creation"
|
|
|
|
"test_default_orders_is_applied_on_related_two_fields"
|
|
|
|
"test_default_orders_is_applied_from_relation"
|
|
|
|
"test_sum_method"
|
|
|
|
"test_count_method "
|
|
|
|
"test_queryset_methods"
|
|
|
|
"test_queryset_update"
|
|
|
|
"test_selecting_subset"
|
|
|
|
"test_selecting_subset_of_through_model"
|
|
|
|
"test_simple_queryset_values"
|
|
|
|
"test_queryset_values_nested_relation"
|
|
|
|
"test_queryset_simple_values_list"
|
|
|
|
"test_queryset_nested_relation_values_list"
|
|
|
|
"test_queryset_nested_relation_subset_of_fields_values_list"
|
|
|
|
"test_m2m_values"
|
|
|
|
"test_nested_m2m"
|
|
|
|
"test_nested_flatten_and_exception"
|
|
|
|
"test_queryset_values_multiple_select_related"
|
|
|
|
"test_querysetproxy_values"
|
|
|
|
"test_querysetproxy_values_list"
|
|
|
|
"test_reverse_many_to_many_cascade"
|
|
|
|
"test_not_saved_raises_error"
|
|
|
|
"test_not_existing_raises_error"
|
|
|
|
"test_assigning_related_objects"
|
|
|
|
"test_quering_of_the_m2m_models"
|
|
|
|
"test_removal_of_the_relations"
|
|
|
|
"test_selecting_related"
|
|
|
|
"test_adding_unsaved_related"
|
|
|
|
"test_removing_unsaved_related"
|
|
|
|
"test_quering_of_related_model_works_but_no_result"
|
2022-01-03 16:56:52 +00:00
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "ormar" ];
|
2022-01-03 16:56:52 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2022-02-20 05:27:41 +00:00
|
|
|
description = "Async ORM with fastapi in mind and pydantic validation";
|
2022-04-27 09:35:20 +00:00
|
|
|
homepage = "https://github.com/collerek/ormar";
|
2023-02-02 18:25:31 +00:00
|
|
|
changelog = "https://github.com/collerek/ormar/releases/tag/${version}";
|
2022-01-03 16:56:52 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ andreasfelix ];
|
|
|
|
};
|
|
|
|
}
|