2021-06-28 23:13:55 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
2022-09-30 11:47:45 +00:00
|
|
|
, isPyPy
|
|
|
|
, pythonOlder
|
2021-06-28 23:13:55 +00:00
|
|
|
, fetchPypi
|
|
|
|
, buildPythonPackage
|
2022-09-30 11:47:45 +00:00
|
|
|
|
|
|
|
# build
|
|
|
|
, cython
|
|
|
|
|
|
|
|
# propagates
|
2021-06-28 23:13:55 +00:00
|
|
|
, greenlet
|
|
|
|
, importlib-metadata
|
2022-09-30 11:47:45 +00:00
|
|
|
, typing-extensions
|
|
|
|
|
|
|
|
# optionals
|
|
|
|
, aiosqlite
|
|
|
|
, asyncmy
|
|
|
|
, asyncpg
|
|
|
|
, cx_oracle
|
|
|
|
, mariadb
|
|
|
|
, mypy
|
|
|
|
, mysql-connector
|
|
|
|
, mysqlclient
|
|
|
|
# TODO: oracledb
|
|
|
|
, pg8000
|
|
|
|
, psycopg
|
|
|
|
, psycopg2
|
|
|
|
, psycopg2cffi
|
|
|
|
# TODO: pymssql
|
|
|
|
, pymysql
|
|
|
|
, pyodbc
|
|
|
|
# TODO: sqlcipher3
|
|
|
|
|
|
|
|
# tests
|
2020-04-24 23:36:52 +00:00
|
|
|
, mock
|
|
|
|
, pytestCheckHook
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "SQLAlchemy";
|
2022-11-02 22:02:43 +00:00
|
|
|
version = "1.4.41"; # TODO: check python3Packages.fastapi when updating to >= 1.4.42
|
2022-09-30 11:47:45 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2022-09-30 11:47:45 +00:00
|
|
|
hash = "sha256-ApL3DReX48VOhi5vMK5HQBRki8nHI+FKL9pzCtsKl5E=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
nativeBuildInputs = lib.optionals (!isPyPy) [
|
|
|
|
cython
|
|
|
|
];
|
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
greenlet
|
2022-09-30 11:47:45 +00:00
|
|
|
typing-extensions
|
2021-06-28 23:13:55 +00:00
|
|
|
] ++ lib.optionals (pythonOlder "3.8") [
|
|
|
|
importlib-metadata
|
2021-03-09 03:18:52 +00:00
|
|
|
];
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
passthru.optional-dependencies = rec {
|
|
|
|
asyncio = [
|
|
|
|
greenlet
|
|
|
|
];
|
|
|
|
mypy = [
|
|
|
|
#mypy
|
|
|
|
];
|
|
|
|
mssql = [
|
|
|
|
pyodbc
|
|
|
|
];
|
|
|
|
mssql_pymysql = [
|
|
|
|
# TODO: pymssql
|
|
|
|
];
|
|
|
|
mssql_pyodbc = [
|
|
|
|
pyodbc
|
|
|
|
];
|
|
|
|
mysql = [
|
|
|
|
mysqlclient
|
|
|
|
];
|
|
|
|
mysql_connector = [
|
|
|
|
mysql-connector
|
|
|
|
];
|
|
|
|
mariadb_connector = [
|
|
|
|
mariadb
|
|
|
|
];
|
|
|
|
oracle = [
|
|
|
|
cx_oracle
|
|
|
|
];
|
|
|
|
oracle_oracledb = [
|
|
|
|
# TODO: oracledb
|
|
|
|
];
|
|
|
|
postgresql = [
|
|
|
|
psycopg2
|
|
|
|
];
|
|
|
|
postgresql_pg8000 = [
|
|
|
|
pg8000
|
|
|
|
];
|
|
|
|
postgresql_asyncpg = [
|
|
|
|
asyncpg
|
|
|
|
] ++ asyncio;
|
|
|
|
postgresql_psycopg2binary = [
|
|
|
|
psycopg2
|
|
|
|
];
|
|
|
|
postgresql_psycopg2cffi = [
|
|
|
|
psycopg2cffi
|
|
|
|
];
|
|
|
|
postgresql_psycopg = [
|
|
|
|
psycopg
|
|
|
|
];
|
|
|
|
pymysql = [
|
|
|
|
pymysql
|
|
|
|
];
|
|
|
|
aiomysql = [
|
|
|
|
aiomysql
|
|
|
|
] ++ asyncio;
|
|
|
|
asyncmy = [
|
|
|
|
asyncmy
|
|
|
|
] ++ asyncio;
|
|
|
|
aiosqlite = [
|
|
|
|
aiosqlite
|
|
|
|
typing-extensions
|
|
|
|
] ++ asyncio;
|
|
|
|
sqlcipher = [
|
|
|
|
# TODO: sqlcipher3
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
checkInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
mock
|
2022-09-30 11:47:45 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# disable mem-usage tests on mac, has trouble serializing pickle files
|
2021-06-28 23:13:55 +00:00
|
|
|
disabledTests = lib.optionals stdenv.isDarwin [
|
|
|
|
"MemUsageWBackendTest"
|
|
|
|
"MemUsageTest"
|
|
|
|
];
|
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;
|
|
|
|
};
|
|
|
|
}
|