2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
2021-12-06 16:07:01 +00:00
|
|
|
, apsw
|
2021-02-05 17:12:51 +00:00
|
|
|
, buildPythonPackage
|
2020-04-24 23:36:52 +00:00
|
|
|
, cython
|
2021-12-06 16:07:01 +00:00
|
|
|
, fetchFromGitHub
|
2020-04-24 23:36:52 +00:00
|
|
|
, flask
|
2021-12-06 16:07:01 +00:00
|
|
|
, python
|
|
|
|
, sqlite
|
|
|
|
, withMysql ? false
|
|
|
|
, mysql-connector
|
|
|
|
, withPostgres ? false
|
|
|
|
, psycopg2
|
2022-07-14 12:49:19 +00:00
|
|
|
, pythonOlder
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "peewee";
|
2022-07-14 12:49:19 +00:00
|
|
|
version = "3.15.0";
|
2021-12-06 16:07:01 +00:00
|
|
|
format = "setuptools";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-07-14 12:49:19 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "coleifer";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2022-07-14 12:49:19 +00:00
|
|
|
hash = "sha256-nmqq1RJzHZKp6f0RAxuUAejy04vsupV0IH8dHXM/WVw=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
sqlite
|
2021-12-06 16:07:01 +00:00
|
|
|
cython
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
2021-12-06 16:07:01 +00:00
|
|
|
apsw
|
2022-04-27 09:35:20 +00:00
|
|
|
] ++ lib.optional withPostgres [
|
|
|
|
psycopg2
|
|
|
|
] ++ lib.optional withMysql [
|
|
|
|
mysql-connector
|
|
|
|
];
|
2021-12-06 16:07:01 +00:00
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
flask
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-06-15 15:56:04 +00:00
|
|
|
doCheck = withPostgres;
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
checkPhase = ''
|
|
|
|
rm -r playhouse # avoid using the folder in the cwd
|
|
|
|
${python.interpreter} runtests.py
|
|
|
|
'';
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"peewee"
|
|
|
|
];
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2021-12-06 16:07:01 +00:00
|
|
|
description = "Python ORM with support for various database implementation";
|
|
|
|
homepage = "http://peewee-orm.com";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|