about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/factory-boy/default.nix
blob: 2269445282bdf93406a98ee19b64222bdc0ffcaf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
{ lib
, buildPythonPackage
, django
, faker
, fetchPypi
, flask
, flask-sqlalchemy
, mongoengine
, pytestCheckHook
, pythonOlder
, sqlalchemy
, sqlalchemy-utils
}:

buildPythonPackage rec {
  pname = "factory-boy";
  version = "3.3.0";
  format = "setuptools";

  disabled = pythonOlder "3.7";

  src = fetchPypi {
    pname = "factory_boy";
    inherit version;
    hash = "sha256-vHbZfRplu9mEKm1yKIIJjrVJ7I7hCB+fsuj/KfDDAPE=";
  };

  postPatch = ''
    substituteInPlace tests/test_version.py \
      --replace '"3.2.1.dev0")' '"${version}")'
  '';

  propagatedBuildInputs = [
    faker
  ];

  nativeCheckInputs = [
    django
    flask
    flask-sqlalchemy
    mongoengine
    pytestCheckHook
    sqlalchemy
    sqlalchemy-utils
  ];

  # Checks for MongoDB requires an a running DB
  disabledTests = [
    "MongoEngineTestCase"
  ];

  disabledTestPaths = [
    # incompatible with latest flask-sqlalchemy
    "examples/flask_alchemy/test_demoapp.py"
  ];

  pythonImportsCheck = [
    "factory"
  ];

  meta = with lib; {
    description = "Python package to create factories for complex objects";
    homepage = "https://github.com/rbarrois/factory_boy";
    changelog = "https://github.com/FactoryBoy/factory_boy/blob/${version}/docs/changelog.rst";
    license = with licenses; [ mit ];
    maintainers = with maintainers; [ fab ];
  };
}