2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
apsw,
|
|
|
|
buildPythonPackage,
|
|
|
|
cython,
|
|
|
|
fetchFromGitHub,
|
|
|
|
flask,
|
|
|
|
python,
|
|
|
|
sqlite,
|
|
|
|
withMysql ? false,
|
|
|
|
mysql-connector,
|
|
|
|
withPostgres ? false,
|
|
|
|
psycopg2,
|
|
|
|
pythonOlder,
|
|
|
|
setuptools,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "peewee";
|
2024-06-05 15:53:02 +00:00
|
|
|
version = "3.17.5";
|
|
|
|
pyproject = true;
|
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";
|
2024-06-05 15:53:02 +00:00
|
|
|
repo = "peewee";
|
2022-08-12 12:06:08 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2024-06-05 15:53:02 +00:00
|
|
|
hash = "sha256-2SrqWPyeDBKOweLu7bEcDIAqCCtnKv0VBdzfpaA22ow=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
build-system = [ setuptools ];
|
|
|
|
|
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
|
2024-06-05 15:53:02 +00:00
|
|
|
] ++ lib.optionals withPostgres [ psycopg2 ] ++ lib.optionals withMysql [ mysql-connector ];
|
2021-12-06 16:07:01 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs = [ 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
|
|
|
|
'';
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "peewee" ];
|
2021-12-06 16:07:01 +00:00
|
|
|
|
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";
|
2024-06-05 15:53:02 +00:00
|
|
|
changelog = "https://github.com/coleifer/peewee/blob/${version}/CHANGELOG.md";
|
2021-12-06 16:07:01 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ ];
|
2024-06-05 15:53:02 +00:00
|
|
|
mainProgram = "pwiz.py";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|