2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
fetchFromGitHub,
|
|
|
|
buildPythonPackage,
|
|
|
|
importlib-metadata,
|
|
|
|
importlib-resources,
|
|
|
|
setuptools,
|
|
|
|
pythonOlder,
|
|
|
|
pytestCheckHook,
|
2023-01-20 10:41:00 +00:00
|
|
|
}:
|
2020-06-18 07:06:33 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "fake-useragent";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "1.5.1";
|
2024-01-02 11:29:13 +00:00
|
|
|
pyproject = true;
|
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}";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-BDXJJeT29GWkN9DoVl8sxXFpV/eMqu3mqlvMr2lzJM8=";
|
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
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeBuildInputs = [ setuptools ];
|
2023-01-20 10:41:00 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
propagatedBuildInputs =
|
|
|
|
[ ]
|
|
|
|
++ lib.optionals (pythonOlder "3.10") [ importlib-resources ]
|
|
|
|
++ lib.optionals (pythonOlder "3.8") [ importlib-metadata ];
|
2023-01-20 10:41:00 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2020-06-18 07:06:33 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "fake_useragent" ];
|
2024-01-02 11:29:13 +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 ];
|
|
|
|
};
|
|
|
|
}
|