1{ lib
2, fetchPypi
3, fetchpatch
4, buildPythonPackage
5, pytest
6, mock
7, isPy3k
8, pysqlite
9}:
10
11buildPythonPackage rec {
12 pname = "SQLAlchemy";
13 version = "1.2.14";
14
15 src = fetchPypi {
16 inherit pname version;
17 sha256 = "9de7c7dabcf06319becdb7e15099c44e5e34ba7062f9ba10bc00e562f5db3d04";
18 };
19
20 patches = [
21 # fix for failing doc tests
22 # https://bitbucket.org/zzzeek/sqlalchemy/issues/4370/sqlite-325x-docs-tutorialrst-doctests-fail
23 (fetchpatch {
24 name = "doc-test-fixes.patch";
25 url = https://bitbucket.org/zzzeek/sqlalchemy/commits/63279a69e2b9277df5e97ace161fa3a1bb4f29cd/raw;
26 sha256 = "1x25aj5hqmgjdak4hllya0rf0srr937k1hwaxb24i9ban607hjri";
27 })
28 ];
29
30 checkInputs = [
31 pytest
32 mock
33# Disable pytest_xdist tests for now, because our version seems to be too new.
34# pytest_xdist
35 ] ++ lib.optional (!isPy3k) pysqlite;
36
37 checkPhase = ''
38 py.test -k "not test_round_trip_direct_type_affinity"
39 '';
40
41 meta = with lib; {
42 homepage = http://www.sqlalchemy.org/;
43 description = "A Python SQL toolkit and Object Relational Mapper";
44 license = licenses.mit;
45 };
46}