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-07-27 06:49:29 +00:00
|
|
|
version = "3.17.6";
|
2024-06-05 15:53:02 +00:00
|
|
|
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-07-27 06:49:29 +00:00
|
|
|
hash = "sha256-HluoCXblqwaOb+gtAhvaYshTj9CtHoegn0QUaq0V+eA=";
|
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;
|
2024-07-31 10:19:44 +00:00
|
|
|
maintainers = [ ];
|
2024-06-05 15:53:02 +00:00
|
|
|
mainProgram = "pwiz.py";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|