2018-10-01 21:12:46 +00:00
|
|
|
{ stdenv, lib, buildPythonPackage, fetchFromGitHub
|
|
|
|
, sqlite
|
|
|
|
, cython
|
|
|
|
, apsw
|
|
|
|
, flask
|
|
|
|
, withPostgres ? false, psycopg2
|
|
|
|
, withMysql ? false, mysql-connector
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
|
|
|
|
pname = "peewee";
|
2018-12-24 20:44:28 +00:00
|
|
|
version = "3.8.0";
|
2018-10-01 21:12:46 +00:00
|
|
|
|
|
|
|
# pypi release does not provide tests
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "coleifer";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2018-12-24 20:44:28 +00:00
|
|
|
sha256 = "0kqhpalw1587zaz3fcj13mpzs5950l6fm3qlcfqsfp16h8w0s89f";
|
2018-10-01 21:12:46 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
checkInputs = [ flask ];
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
rm -r playhouse # avoid using the folder in the cwd
|
|
|
|
python runtests.py
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
sqlite
|
|
|
|
cython # compile speedups
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
apsw # sqlite performance improvement
|
|
|
|
] ++ (lib.optional withPostgres psycopg2)
|
|
|
|
++ (lib.optional withMysql mysql-connector);
|
|
|
|
|
|
|
|
meta = with stdenv.lib;{
|
|
|
|
description = "a small, expressive orm";
|
|
|
|
homepage = http://peewee-orm.com;
|
|
|
|
license = licenses.mit;
|
|
|
|
};
|
|
|
|
}
|