1{ lib, buildPythonPackage, fetchPypi, pythonOlder,
2 # Build inputs
3 dateutil, six, text-unidecode, ipaddress ? null,
4 # Test inputs
5 email_validator, mock, ukpostcodeparser, pytestrunner, pytest}:
6
7assert pythonOlder "3.3" -> ipaddress != null;
8
9buildPythonPackage rec {
10 pname = "Faker";
11 version = "1.0.2";
12
13 src = fetchPypi {
14 inherit pname version;
15 sha256 = "0v1pjzn9z20ckgv3kji7c8nwcsm7670z4i43ic9skjrdbcqylwfq";
16 };
17
18 buildInputs = [ pytestrunner ];
19 checkInputs = [
20 email_validator
21 mock
22 ukpostcodeparser
23 pytest
24 ];
25
26 propagatedBuildInputs = [
27 dateutil
28 six
29 text-unidecode
30 ] ++ lib.optional (pythonOlder "3.3") ipaddress;
31
32 postPatch = ''
33 find tests -type d -name "__pycache__" | xargs rm -r
34 substituteInPlace setup.py --replace "pytest>=3.8.0,<3.9" "pytest"
35 '';
36
37 meta = with lib; {
38 description = "A Python library for generating fake user data";
39 homepage = http://faker.rtfd.org;
40 license = licenses.mit;
41 maintainers = with maintainers; [ lovek323 ];
42 platforms = platforms.unix;
43 };
44}