depot/third_party/nixpkgs/pkgs/development/python-modules/peewee/default.nix
Default email ce641f4048 Project import generated by Copybara.
GitOrigin-RevId: bc5d68306b40b8522ffb69ba6cff91898c2fbbff
2021-12-06 17:07:01 +01:00

58 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.8";
format = "setuptools";
src = fetchFromGitHub {
owner = "coleifer";
repo = pname;
rev = version;
sha256 = "sha256-BJSM+7+VdW6SxN4/AXsX8NhQPdIFoYrVRVwR9OsJ3QE=";
};
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; [ ];
};
}