2021-01-24 00:29:22 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
2018-10-01 21:12:46 +00:00
|
|
|
, sqlite
|
|
|
|
, cython
|
|
|
|
, apsw
|
|
|
|
, flask
|
|
|
|
, withPostgres ? false, psycopg2
|
|
|
|
, withMysql ? false, mysql-connector
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
|
|
|
|
pname = "peewee";
|
2021-05-07 12:00:00 +00:00
|
|
|
version = "3.14.4";
|
2018-10-01 21:12:46 +00:00
|
|
|
|
|
|
|
# pypi release does not provide tests
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "coleifer";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2021-05-07 12:00:00 +00:00
|
|
|
sha256 = "0x85swpaffysc05kka0mab87cnilzw1lpacfhcx5ayabh0i2qsh6";
|
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);
|
|
|
|
|
2020-06-06 12:00:00 +00:00
|
|
|
doCheck = withPostgres;
|
|
|
|
|
2021-01-24 00:29:22 +00:00
|
|
|
meta = with lib; {
|
2018-10-01 21:12:46 +00:00
|
|
|
description = "a small, expressive orm";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "http://peewee-orm.com";
|
2018-10-01 21:12:46 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
};
|
|
|
|
}
|