2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
2022-12-02 08:20:57 +00:00
|
|
|
, aiomysql
|
|
|
|
, aiopg
|
|
|
|
, aiosqlite
|
|
|
|
, asyncmy
|
|
|
|
, asyncpg
|
2020-04-24 23:36:52 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
2021-05-20 23:08:51 +00:00
|
|
|
, pytestCheckHook
|
2022-12-02 08:20:57 +00:00
|
|
|
, pythonOlder
|
|
|
|
, sqlalchemy
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "databases";
|
2023-01-20 10:41:00 +00:00
|
|
|
version = "0.7.0";
|
2022-02-10 20:34:41 +00:00
|
|
|
format = "setuptools";
|
2021-10-17 09:34:42 +00:00
|
|
|
|
2022-12-02 08:20:57 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "encode";
|
|
|
|
repo = pname;
|
2022-12-02 08:20:57 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2023-01-20 10:41:00 +00:00
|
|
|
hash = "sha256-3RRHXkM8/GoIcO6Y1EZGbnp/X5gzYkW/PV4bzGay6ZI=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
2021-10-17 09:34:42 +00:00
|
|
|
sqlalchemy
|
|
|
|
];
|
|
|
|
|
2022-12-02 08:20:57 +00:00
|
|
|
passthru.optional-dependencies = {
|
|
|
|
postgresql = [
|
|
|
|
asyncpg
|
|
|
|
];
|
|
|
|
asyncpg = [
|
|
|
|
asyncpg
|
|
|
|
];
|
|
|
|
aiopg = [
|
|
|
|
aiopg
|
|
|
|
];
|
|
|
|
mysql = [
|
|
|
|
aiomysql
|
|
|
|
];
|
|
|
|
aiomysql = [
|
|
|
|
aiomysql
|
|
|
|
];
|
|
|
|
asyncmy = [
|
|
|
|
asyncmy
|
|
|
|
];
|
|
|
|
sqlite = [
|
|
|
|
aiosqlite
|
|
|
|
];
|
|
|
|
aiosqlite = [
|
|
|
|
aiosqlite
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-05-20 23:08:51 +00:00
|
|
|
pytestCheckHook
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
disabledTestPaths = [
|
|
|
|
# circular dependency on starlette
|
|
|
|
"tests/test_integration.py"
|
|
|
|
# TEST_DATABASE_URLS is not set.
|
|
|
|
"tests/test_databases.py"
|
2021-10-17 09:34:42 +00:00
|
|
|
"tests/test_connection_options.py"
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"databases"
|
2021-05-20 23:08:51 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Async database support for Python";
|
|
|
|
homepage = "https://github.com/encode/databases";
|
2022-12-02 08:20:57 +00:00
|
|
|
changelog = "https://github.com/encode/databases/releases/tag/${version}";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.bsd3;
|
2021-10-17 09:34:42 +00:00
|
|
|
maintainers = with maintainers; [ costrouc ];
|
2023-03-15 16:39:30 +00:00
|
|
|
# https://github.com/encode/databases/issues/530
|
|
|
|
broken = lib.versionAtLeast sqlalchemy.version "2.0.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|