2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
2020-04-24 23:36:52 +00:00
|
|
|
, sqlite
|
|
|
|
, cython
|
|
|
|
, apsw
|
|
|
|
, flask
|
|
|
|
, withPostgres ? false, psycopg2
|
|
|
|
, withMysql ? false, mysql-connector
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
|
|
|
|
pname = "peewee";
|
2020-06-15 15:56:04 +00:00
|
|
|
version = "3.13.3";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# pypi release does not provide tests
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "coleifer";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2020-06-15 15:56:04 +00:00
|
|
|
sha256 = "1r67hxb9m6v0xbnbqfnsw6dahmdr94pf81b4x51jfw6x9sa4izi4";
|
2020-04-24 23:36:52 +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-15 15:56:04 +00:00
|
|
|
doCheck = withPostgres;
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "a small, expressive orm";
|
|
|
|
homepage = "http://peewee-orm.com";
|
|
|
|
license = licenses.mit;
|
|
|
|
};
|
|
|
|
}
|