2023-01-20 10:41:00 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, buildPythonPackage
|
|
|
|
, importlib-metadata
|
|
|
|
, importlib-resources
|
|
|
|
, setuptools
|
|
|
|
, pythonOlder
|
|
|
|
, pytestCheckHook
|
|
|
|
}:
|
2020-06-18 07:06:33 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "fake-useragent";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "1.3.0";
|
2023-01-20 10:41:00 +00:00
|
|
|
format = "pyproject";
|
2020-06-18 07:06:33 +00:00
|
|
|
|
2023-03-27 19:17:25 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "fake-useragent";
|
|
|
|
repo = "fake-useragent";
|
|
|
|
rev = "refs/tags/${version}";
|
2023-10-09 19:29:22 +00:00
|
|
|
hash = "sha256-erGX52ipM0scn3snICf6ipjgVbV8/H5xT4GP3AtvOwo=";
|
2020-06-18 07:06:33 +00:00
|
|
|
};
|
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
postPatch = ''
|
|
|
|
sed -i '/addopts/d' pytest.ini
|
|
|
|
'';
|
2020-06-18 07:06:33 +00:00
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
] ++ lib.optionals (pythonOlder "3.10") [
|
|
|
|
importlib-resources
|
|
|
|
] ++ lib.optionals (pythonOlder "3.8") [
|
|
|
|
importlib-metadata
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2023-01-20 10:41:00 +00:00
|
|
|
pytestCheckHook
|
|
|
|
];
|
2020-06-18 07:06:33 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-06-18 07:06:33 +00:00
|
|
|
description = "Up to date simple useragent faker with real world database";
|
|
|
|
homepage = "https://github.com/hellysmile/fake-useragent";
|
2023-03-27 19:17:25 +00:00
|
|
|
changelog = "https://github.com/fake-useragent/fake-useragent/releases/tag/${version}";
|
2020-06-18 07:06:33 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ evanjs ];
|
|
|
|
};
|
|
|
|
}
|