1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pymongo
5, isPy27
6, six
7, blinker
8, nose
9, pillow
10, coverage
11}:
12
13buildPythonPackage rec {
14 pname = "mongoengine";
15 version = "0.26.0";
16 disabled = isPy27;
17
18 src = fetchFromGitHub {
19 owner = "MongoEngine";
20 repo = pname;
21 rev = "refs/tags/v${version}";
22 hash = "sha256-mPz9Nyoyke++e9vBWSKunc9VGHCP8pbmldgKty5HIMA=";
23 };
24
25 propagatedBuildInputs = [
26 pymongo
27 six
28 ];
29
30 nativeCheckInputs = [
31 nose
32 pillow
33 coverage
34 blinker
35 ];
36
37 postPatch = ''
38 substituteInPlace setup.py \
39 --replace "coverage==4.2" "coverage" \
40 --replace "pymongo>=3.4,<=4.0" "pymongo"
41 '';
42
43 # tests require mongodb running in background
44 doCheck = false;
45
46 pythonImportsCheck = [ "mongoengine" ];
47
48 meta = with lib; {
49 description = "MongoEngine is a Python Object-Document Mapper for working with MongoDB";
50 homepage = "http://mongoengine.org/";
51 license = licenses.mit;
52 maintainers = [ maintainers.costrouc ];
53 };
54}