1{ lib, buildPythonPackage, fetchPypi, pythonOlder,
2 # Build inputs
3 dateutil, six, text-unidecode, ipaddress ? null
4 # Test inputs
5 , email_validator
6 , freezegun
7 , mock
8 , more-itertools
9 , pytest
10 , pytestrunner
11 , random2
12 , ukpostcodeparser
13 , validators
14}:
15
16assert pythonOlder "3.3" -> ipaddress != null;
17
18buildPythonPackage rec {
19 pname = "Faker";
20 version = "4.1.2";
21
22 src = fetchPypi {
23 inherit pname version;
24 sha256 = "ff188c416864e3f7d8becd8f9ee683a4b4101a2a2d2bcdcb3e84bb1bdd06eaae";
25 };
26
27 nativeBuildInputs = [ pytestrunner ];
28 checkInputs = [
29 email_validator
30 freezegun
31 pytest
32 random2
33 ukpostcodeparser
34 validators
35 ]
36 ++ lib.optionals (pythonOlder "3.3") [ mock ]
37 ++ lib.optionals (pythonOlder "3.0") [ more-itertools ];
38
39 propagatedBuildInputs = [
40 dateutil
41 six
42 text-unidecode
43 ];
44
45 postPatch = ''
46 substituteInPlace setup.py --replace "pytest>=3.8.0,<3.9" "pytest"
47 '';
48
49 meta = with lib; {
50 description = "A Python library for generating fake user data";
51 homepage = "http://faker.rtfd.org";
52 license = licenses.mit;
53 maintainers = with maintainers; [ lovek323 ];
54 platforms = platforms.unix;
55 };
56}