2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
isPyPy,
|
|
|
|
pythonOlder,
|
|
|
|
fetchFromGitHub,
|
|
|
|
buildPythonPackage,
|
2022-09-30 11:47:45 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
# build
|
|
|
|
cython,
|
|
|
|
setuptools,
|
2022-09-30 11:47:45 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
# propagates
|
|
|
|
greenlet,
|
|
|
|
typing-extensions,
|
2022-09-30 11:47:45 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
# optionals
|
|
|
|
aiomysql,
|
|
|
|
aiosqlite,
|
|
|
|
asyncmy,
|
|
|
|
asyncpg,
|
|
|
|
cx-oracle,
|
|
|
|
mariadb,
|
|
|
|
mypy,
|
|
|
|
mysql-connector,
|
|
|
|
mysqlclient,
|
|
|
|
oracledb,
|
|
|
|
pg8000,
|
|
|
|
psycopg,
|
|
|
|
psycopg2,
|
|
|
|
psycopg2cffi,
|
|
|
|
# TODO: pymssql
|
|
|
|
pymysql,
|
|
|
|
pyodbc,
|
|
|
|
# TODO: sqlcipher3
|
2022-09-30 11:47:45 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
# tests
|
|
|
|
mock,
|
|
|
|
pytest-xdist,
|
|
|
|
pytestCheckHook,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2024-04-21 15:54:59 +00:00
|
|
|
pname = "sqlalchemy";
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "2.0.30";
|
2023-03-15 16:39:30 +00:00
|
|
|
format = "pyproject";
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-04-29 16:46:19 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "sqlalchemy";
|
|
|
|
repo = "sqlalchemy";
|
|
|
|
rev = "refs/tags/rel_${lib.replaceStrings [ "." ] [ "_" ] version}";
|
2024-05-15 15:35:15 +00:00
|
|
|
hash = "sha256-l6VxBK4RT/sAFkz3g633MrfQH9Bvp/JE12mdtqjsxd8=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
postPatch = ''
|
|
|
|
sed -i '/tag_build = dev/d' setup.cfg
|
|
|
|
'';
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeBuildInputs = [ setuptools ] ++ lib.optionals (!isPyPy) [ cython ];
|
2022-09-30 11:47:45 +00:00
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
greenlet
|
2022-09-30 11:47:45 +00:00
|
|
|
typing-extensions
|
2021-03-09 03:18:52 +00:00
|
|
|
];
|
|
|
|
|
2023-04-29 16:46:19 +00:00
|
|
|
passthru.optional-dependencies = lib.fix (self: {
|
2024-06-05 15:53:02 +00:00
|
|
|
asyncio = [ greenlet ];
|
|
|
|
mypy = [ mypy ];
|
|
|
|
mssql = [ pyodbc ];
|
2022-09-30 11:47:45 +00:00
|
|
|
mssql_pymysql = [
|
|
|
|
# TODO: pymssql
|
|
|
|
];
|
2024-06-05 15:53:02 +00:00
|
|
|
mssql_pyodbc = [ pyodbc ];
|
|
|
|
mysql = [ mysqlclient ];
|
|
|
|
mysql_connector = [ mysql-connector ];
|
|
|
|
mariadb_connector = [ mariadb ];
|
|
|
|
oracle = [ cx-oracle ];
|
|
|
|
oracle_oracledb = [ oracledb ];
|
|
|
|
postgresql = [ psycopg2 ];
|
|
|
|
postgresql_pg8000 = [ pg8000 ];
|
|
|
|
postgresql_asyncpg = [ asyncpg ] ++ self.asyncio;
|
|
|
|
postgresql_psycopg2binary = [ psycopg2 ];
|
|
|
|
postgresql_psycopg2cffi = [ psycopg2cffi ];
|
|
|
|
postgresql_psycopg = [ psycopg ];
|
|
|
|
postgresql_psycopgbinary = [ psycopg ];
|
|
|
|
pymysql = [ pymysql ];
|
|
|
|
aiomysql = [ aiomysql ] ++ self.asyncio;
|
|
|
|
asyncmy = [ asyncmy ] ++ self.asyncio;
|
2022-09-30 11:47:45 +00:00
|
|
|
aiosqlite = [
|
|
|
|
aiosqlite
|
|
|
|
typing-extensions
|
2023-04-29 16:46:19 +00:00
|
|
|
] ++ self.asyncio;
|
2022-09-30 11:47:45 +00:00
|
|
|
sqlcipher = [
|
|
|
|
# TODO: sqlcipher3
|
|
|
|
];
|
2023-04-29 16:46:19 +00:00
|
|
|
});
|
2022-09-30 11:47:45 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2023-03-15 16:39:30 +00:00
|
|
|
pytest-xdist
|
2020-04-24 23:36:52 +00:00
|
|
|
pytestCheckHook
|
|
|
|
mock
|
2022-09-30 11:47:45 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-03-15 16:39:30 +00:00
|
|
|
disabledTestPaths = [
|
|
|
|
# typing correctness, not interesting
|
|
|
|
"test/ext/mypy"
|
2023-08-04 22:07:22 +00:00
|
|
|
"test/typing"
|
2023-03-15 16:39:30 +00:00
|
|
|
# slow and high memory usage, not interesting
|
|
|
|
"test/aaa_profiling"
|
2021-06-28 23:13:55 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2024-06-05 15:53:02 +00:00
|
|
|
changelog = "https://github.com/sqlalchemy/sqlalchemy/releases/tag/rel_${
|
|
|
|
builtins.replaceStrings [ "." ] [ "_" ] version
|
|
|
|
}";
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Python SQL toolkit and Object Relational Mapper";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "http://www.sqlalchemy.org/";
|
|
|
|
license = licenses.mit;
|
|
|
|
};
|
|
|
|
}
|