3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/python-modules/peewee/default.nix
2022-03-14 00:28:57 +01:00

59 lines
1 KiB
Nix

{ lib
, apsw
, buildPythonPackage
, cython
, fetchFromGitHub
, flask
, python
, sqlite
, withMysql ? false
, mysql-connector
, withPostgres ? false
, psycopg2
}:
buildPythonPackage rec {
pname = "peewee";
version = "3.14.9";
format = "setuptools";
src = fetchFromGitHub {
owner = "coleifer";
repo = pname;
rev = version;
sha256 = "sha256-8rwWKsOOYUrk2k1piCurb1LkB9zzmSITq52qWdyx4yk=";
};
buildInputs = [
sqlite
cython
];
propagatedBuildInputs = [
apsw
] ++ lib.optional withPostgres psycopg2
++ lib.optional withMysql mysql-connector;
checkInputs = [
flask
];
doCheck = withPostgres;
checkPhase = ''
rm -r playhouse # avoid using the folder in the cwd
${python.interpreter} runtests.py
'';
pythonImportsCheck = [
"peewee"
];
meta = with lib; {
description = "Python ORM with support for various database implementation";
homepage = "http://peewee-orm.com";
license = licenses.mit;
maintainers = with maintainers; [ ];
};
}