2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
aiomysql,
|
|
|
|
aiopg,
|
|
|
|
aiosqlite,
|
|
|
|
asyncmy,
|
|
|
|
asyncpg,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
|
|
|
setuptools,
|
|
|
|
sqlalchemy,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "databases";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "0.9.0";
|
|
|
|
pyproject = true;
|
2021-10-17 09:34:42 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
disabled = pythonOlder "3.8";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "encode";
|
2024-04-21 15:54:59 +00:00
|
|
|
repo = "databases";
|
2022-12-02 08:20:57 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-Zf9QqBgDhWAnHdNvzjXtri5rdT00BOjc4YTNzJALldM=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeBuildInputs = [ setuptools ];
|
2024-04-21 15:54:59 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
propagatedBuildInputs = [ sqlalchemy ];
|
2021-10-17 09:34:42 +00:00
|
|
|
|
2022-12-02 08:20:57 +00:00
|
|
|
passthru.optional-dependencies = {
|
2024-06-05 15:53:02 +00:00
|
|
|
postgresql = [ asyncpg ];
|
|
|
|
asyncpg = [ asyncpg ];
|
|
|
|
aiopg = [ aiopg ];
|
|
|
|
mysql = [ aiomysql ];
|
|
|
|
aiomysql = [ aiomysql ];
|
|
|
|
asyncmy = [ asyncmy ];
|
|
|
|
sqlite = [ aiosqlite ];
|
|
|
|
aiosqlite = [ aiosqlite ];
|
2022-12-02 08:20:57 +00:00
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs = [ 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"
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "databases" ];
|
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;
|
2023-08-04 22:07:22 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|