2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
2020-10-07 09:15:18 +00:00
|
|
|
, pythonOlder
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchFromGitHub
|
2021-04-17 00:35:05 +00:00
|
|
|
, poetry-core
|
|
|
|
, fetchpatch
|
2020-10-07 09:15:18 +00:00
|
|
|
, pytestCheckHook
|
2020-04-24 23:36:52 +00:00
|
|
|
, pycodestyle
|
|
|
|
, pyyaml
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "tinydb";
|
2021-04-17 00:35:05 +00:00
|
|
|
version = "4.4.0";
|
2020-10-07 09:15:18 +00:00
|
|
|
disabled = pythonOlder "3.5";
|
|
|
|
format = "pyproject";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "msiemens";
|
|
|
|
repo = pname;
|
2020-10-07 09:15:18 +00:00
|
|
|
rev = "v${version}";
|
2021-04-17 00:35:05 +00:00
|
|
|
sha256 = "sha256-3FbsnLU7G4VVhI5NYRqCEQgo51zDeAkEhH69H52zr/w=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-04-17 00:35:05 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
poetry-core
|
|
|
|
];
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
# Switch to poetry-core, https://github.com/msiemens/tinydb/pull/391
|
|
|
|
(fetchpatch {
|
|
|
|
name = "switch-to-peotry-core.patch";
|
|
|
|
url = "https://github.com/msiemens/tinydb/commit/5b547c18e7ce9f5925d5943dfa47d408435a0da5.patch";
|
|
|
|
sha256 = "19ma9ib020b82sn1mcr7sfysqbj8h6nbb365bih1x1wn3ym8xlbc";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pytest.ini \
|
|
|
|
--replace "--cov-append --cov-report term --cov tinydb" ""
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
checkInputs = [
|
2020-10-07 09:15:18 +00:00
|
|
|
pytestCheckHook
|
2020-04-24 23:36:52 +00:00
|
|
|
pycodestyle
|
|
|
|
pyyaml
|
|
|
|
];
|
|
|
|
|
2021-04-17 00:35:05 +00:00
|
|
|
pythonImportsCheck = [ "tinydb" ];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
2021-04-17 00:35:05 +00:00
|
|
|
description = "Lightweight document oriented database written in Python";
|
2020-10-07 09:15:18 +00:00
|
|
|
homepage = "https://tinydb.readthedocs.org/";
|
|
|
|
changelog = "https://tinydb.readthedocs.io/en/latest/changelog.html";
|
|
|
|
license = licenses.mit;
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ marcus7070 ];
|
|
|
|
};
|
|
|
|
}
|