1{ stdenv, lib, fetchPypi, buildPythonPackage, isPy3k, isPy35, fetchpatch
2, mock
3, pysqlite ? null
4, pytestCheckHook
5, pytest_xdist
6}:
7
8buildPythonPackage rec {
9 pname = "SQLAlchemy";
10 version = "1.3.23";
11
12 src = fetchPypi {
13 inherit pname version;
14 sha256 = "6fca33672578666f657c131552c4ef8979c1606e494f78cd5199742dfb26918b";
15 };
16
17 patches = [
18 # fix test_pyodbc_extra_connect_azure test failure
19 (fetchpatch {
20 url = "https://github.com/sqlalchemy/sqlalchemy/commit/7293b3dc0e9eb3dae84ffd831494b85355df8e73.patch";
21 sha256 = "1z61lzxamz74771ddlqmbxba1dcr77f016vqfcmb44dxb228w2db";
22 })
23 ];
24
25 checkInputs = [
26 pytestCheckHook
27 pytest_xdist
28 mock
29 ] ++ lib.optional (!isPy3k) pysqlite;
30
31 pytestFlagsArray = [ "-n auto" ];
32
33 postInstall = ''
34 sed -e 's:--max-worker-restart=5::g' -i setup.cfg
35 '';
36
37 dontUseSetuptoolsCheck = true;
38
39 # disable mem-usage tests on mac, has trouble serializing pickle files
40 disabledTests = lib.optionals isPy35 [ "exception_persistent_flush_py3k "]
41 ++ lib.optionals stdenv.isDarwin [ "MemUsageWBackendTest" "MemUsageTest" ];
42
43 meta = with lib; {
44 homepage = "http://www.sqlalchemy.org/";
45 description = "A Python SQL toolkit and Object Relational Mapper";
46 license = licenses.mit;
47 };
48}