1{ 2 lib, 3 fetchFromGitHub, 4 buildPythonPackage, 5 importlib-metadata, 6 importlib-resources, 7 setuptools, 8 pythonOlder, 9 pytestCheckHook, 10}: 11 12buildPythonPackage rec { 13 pname = "fake-useragent"; 14 version = "2.2.0"; 15 pyproject = true; 16 17 disabled = pythonOlder "3.7"; 18 19 src = fetchFromGitHub { 20 owner = "fake-useragent"; 21 repo = "fake-useragent"; 22 tag = version; 23 hash = "sha256-CaFIXcS5y6m9mAfy4fniuA4VPTl6JfFq1WHnlLFz6fA="; 24 }; 25 26 postPatch = '' 27 sed -i '/addopts/d' pytest.ini 28 ''; 29 30 build-system = [ setuptools ]; 31 32 dependencies = 33 lib.optionals (pythonOlder "3.10") [ importlib-resources ] 34 ++ lib.optionals (pythonOlder "3.8") [ importlib-metadata ]; 35 36 nativeCheckInputs = [ pytestCheckHook ]; 37 38 pythonImportsCheck = [ "fake_useragent" ]; 39 40 disabledTests = lib.optionals (pythonOlder "3.12") [ 41 "test_utils_load_pkg_resource_fallback" 42 ]; 43 44 meta = { 45 changelog = "https://github.com/fake-useragent/fake-useragent/releases/tag/${src.tag}"; 46 description = "Up to date simple useragent faker with real world database"; 47 homepage = "https://github.com/hellysmile/fake-useragent"; 48 license = lib.licenses.asl20; 49 maintainers = with lib.maintainers; [ evanjs ]; 50 }; 51}