2023-04-29 16:46:19 +00:00
|
|
|
{ lib
|
2022-09-30 11:47:45 +00:00
|
|
|
, isPyPy
|
|
|
|
, pythonOlder
|
2023-04-29 16:46:19 +00:00
|
|
|
, fetchFromGitHub
|
2021-06-28 23:13:55 +00:00
|
|
|
, buildPythonPackage
|
2022-09-30 11:47:45 +00:00
|
|
|
|
|
|
|
# build
|
|
|
|
, cython
|
2023-03-15 16:39:30 +00:00
|
|
|
, setuptools
|
2022-09-30 11:47:45 +00:00
|
|
|
|
|
|
|
# propagates
|
2021-06-28 23:13:55 +00:00
|
|
|
, greenlet
|
2022-09-30 11:47:45 +00:00
|
|
|
, typing-extensions
|
|
|
|
|
|
|
|
# optionals
|
2023-04-29 16:46:19 +00:00
|
|
|
, aiomysql
|
2022-09-30 11:47:45 +00:00
|
|
|
, aiosqlite
|
|
|
|
, asyncmy
|
|
|
|
, asyncpg
|
2024-01-13 08:15:51 +00:00
|
|
|
, cx-oracle
|
2022-09-30 11:47:45 +00:00
|
|
|
, mariadb
|
|
|
|
, mypy
|
|
|
|
, mysql-connector
|
|
|
|
, mysqlclient
|
2023-03-15 16:39:30 +00:00
|
|
|
, oracledb
|
2022-09-30 11:47:45 +00:00
|
|
|
, pg8000
|
|
|
|
, psycopg
|
|
|
|
, psycopg2
|
|
|
|
, psycopg2cffi
|
|
|
|
# TODO: pymssql
|
|
|
|
, pymysql
|
|
|
|
, pyodbc
|
|
|
|
# TODO: sqlcipher3
|
|
|
|
|
|
|
|
# tests
|
2020-04-24 23:36:52 +00:00
|
|
|
, mock
|
2023-03-15 16:39:30 +00:00
|
|
|
, pytest-xdist
|
2020-04-24 23:36:52 +00:00
|
|
|
, pytestCheckHook
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "SQLAlchemy";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "2.0.21";
|
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}";
|
2023-11-16 04:20:00 +00:00
|
|
|
hash = "sha256-ldBn+pdZfqnBKdYkOcG47ScH/hBgeJBeIvn1hCIBw/A=";
|
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
|
|
|
|
'';
|
|
|
|
|
2023-03-15 16:39:30 +00:00
|
|
|
nativeBuildInputs =[
|
|
|
|
setuptools
|
|
|
|
] ++ lib.optionals (!isPyPy) [
|
2022-09-30 11:47:45 +00:00
|
|
|
cython
|
|
|
|
];
|
|
|
|
|
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: {
|
2022-09-30 11:47:45 +00:00
|
|
|
asyncio = [
|
|
|
|
greenlet
|
|
|
|
];
|
|
|
|
mypy = [
|
2023-03-15 16:39:30 +00:00
|
|
|
mypy
|
2022-09-30 11:47:45 +00:00
|
|
|
];
|
|
|
|
mssql = [
|
|
|
|
pyodbc
|
|
|
|
];
|
|
|
|
mssql_pymysql = [
|
|
|
|
# TODO: pymssql
|
|
|
|
];
|
|
|
|
mssql_pyodbc = [
|
|
|
|
pyodbc
|
|
|
|
];
|
|
|
|
mysql = [
|
|
|
|
mysqlclient
|
|
|
|
];
|
|
|
|
mysql_connector = [
|
|
|
|
mysql-connector
|
|
|
|
];
|
|
|
|
mariadb_connector = [
|
|
|
|
mariadb
|
|
|
|
];
|
|
|
|
oracle = [
|
2024-01-13 08:15:51 +00:00
|
|
|
cx-oracle
|
2022-09-30 11:47:45 +00:00
|
|
|
];
|
|
|
|
oracle_oracledb = [
|
2023-03-15 16:39:30 +00:00
|
|
|
oracledb
|
2022-09-30 11:47:45 +00:00
|
|
|
];
|
|
|
|
postgresql = [
|
|
|
|
psycopg2
|
|
|
|
];
|
|
|
|
postgresql_pg8000 = [
|
|
|
|
pg8000
|
|
|
|
];
|
|
|
|
postgresql_asyncpg = [
|
|
|
|
asyncpg
|
2023-04-29 16:46:19 +00:00
|
|
|
] ++ self.asyncio;
|
2022-09-30 11:47:45 +00:00
|
|
|
postgresql_psycopg2binary = [
|
|
|
|
psycopg2
|
|
|
|
];
|
|
|
|
postgresql_psycopg2cffi = [
|
|
|
|
psycopg2cffi
|
|
|
|
];
|
|
|
|
postgresql_psycopg = [
|
|
|
|
psycopg
|
|
|
|
];
|
2023-07-15 17:15:38 +00:00
|
|
|
postgresql_psycopgbinary = [
|
|
|
|
psycopg
|
|
|
|
];
|
2022-09-30 11:47:45 +00:00
|
|
|
pymysql = [
|
|
|
|
pymysql
|
|
|
|
];
|
|
|
|
aiomysql = [
|
|
|
|
aiomysql
|
2023-04-29 16:46:19 +00:00
|
|
|
] ++ self.asyncio;
|
2022-09-30 11:47:45 +00:00
|
|
|
asyncmy = [
|
|
|
|
asyncmy
|
2023-04-29 16:46:19 +00:00
|
|
|
] ++ 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; {
|
2022-09-30 11:47:45 +00:00
|
|
|
changelog = "https://github.com/sqlalchemy/sqlalchemy/releases/tag/rel_${builtins.replaceStrings [ "." ] [ "_" ] version}";
|
|
|
|
description = "The Python SQL toolkit and Object Relational Mapper";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "http://www.sqlalchemy.org/";
|
|
|
|
license = licenses.mit;
|
|
|
|
};
|
|
|
|
}
|