11 buildPythonPackage rec {
12 pname = "pymongo-inmemory";
16 disabled = pythonOlder "3.7";
18 src = fetchFromGitHub {
19 owner = "kaizendorks";
20 repo = "pymongo_inmemory";
21 rev = "refs/tags/v${version}";
22 hash = "sha256-FDHHf9x62EqNcHjDF2vH8w8WG/15efEe+fDqGiiOe4A=";
26 # move cache location from nix store to home
27 substituteInPlace pymongo_inmemory/context.py \
29 'CACHE_FOLDER = path.join(path.dirname(__file__), "..", ".cache")' \
30 'CACHE_FOLDER = os.environ.get("XDG_CACHE_HOME", os.environ["HOME"] + "/.cache") + "/pymongo-inmemory"'
32 # fix a broken assumption arising from the above fix
33 substituteInPlace pymongo_inmemory/_utils.py \
35 'os.mkdir(current_path)' \
36 'os.makedirs(current_path)'
39 nativeBuildInputs = [ poetry-core ];
41 dependencies = [ pymongo ];
43 nativeCheckInputs = [ pytestCheckHook ];
46 # new test with insufficient monkey patching, try to remove on next bump
47 "tests/unit/test_mongod.py"
51 export HOME="$(mktemp -d)"
54 pythonImportsCheck = [ "pymongo_inmemory" ];
57 homepage = "https://github.com/kaizendorks/pymongo_inmemory";
58 description = "Mongo mocking library with an ephemeral MongoDB running in memory";
59 maintainers = with lib.maintainers; [ pbsds ];
60 license = lib.licenses.mit;