aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/pkgs/development/python-modules/sqlalchemy/default.nix
blob: 3d76f83c1ee276c2931207d8b18d093ae59683b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{ lib, fetchPypi, buildPythonPackage, isPy3k, isPy35
, mock
, pysqlite
, pytest
}:

buildPythonPackage rec {
  pname = "SQLAlchemy";
  version = "1.3.6";

  src = fetchPypi {
    inherit pname version;
    sha256 = "1zxhabcgzspwrh9l7b68p57kqx4h664a1dp9xr8mi84r472pyzi1";
  };

  checkInputs = [
    pytest
    mock
  ] ++ lib.optional (!isPy3k) pysqlite;

  postInstall = ''
    sed -e 's:--max-worker-restart=5::g' -i setup.cfg
  '';

  checkPhase = if isPy35 then ''
    pytest test -k 'not exception_persistent_flush_py3k'
  '' else ''
    pytest test
  '';

  meta = with lib; {
    homepage = http://www.sqlalchemy.org/;
    description = "A Python SQL toolkit and Object Relational Mapper";
    license = licenses.mit;
  };
}