2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
requests,
|
|
|
|
requests-toolbelt,
|
|
|
|
requests-oauthlib,
|
|
|
|
six,
|
|
|
|
pytestCheckHook,
|
|
|
|
responses,
|
|
|
|
pythonOlder,
|
2024-09-26 11:04:55 +00:00
|
|
|
setuptools,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2022-04-27 09:35:20 +00:00
|
|
|
pname = "flickrapi";
|
|
|
|
version = "2.4";
|
2024-09-26 11:04:55 +00:00
|
|
|
pyproject = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "sybrenstuvel";
|
2024-09-26 11:04:55 +00:00
|
|
|
repo = "flickrapi";
|
2022-04-27 09:35:20 +00:00
|
|
|
rev = "version-${version}";
|
|
|
|
hash = "sha256-vRZrlXKI0UDdmDevh3XUngH4X8G3VlOCSP0z/rxhIgw=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-09-26 11:04:55 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace tests/test_tokencache.py \
|
|
|
|
--replace-fail "assertEquals" "assertEqual" \
|
|
|
|
--replace-fail "assertNotEquals" "assertNotEqual"
|
|
|
|
'';
|
|
|
|
|
|
|
|
build-system = [ setuptools ];
|
|
|
|
|
|
|
|
dependencies = [
|
2022-04-27 09:35:20 +00:00
|
|
|
requests
|
|
|
|
requests-toolbelt
|
|
|
|
requests-oauthlib
|
2022-06-26 10:26:21 +00:00
|
|
|
six
|
2022-04-27 09:35:20 +00:00
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-04-27 09:35:20 +00:00
|
|
|
pytestCheckHook
|
|
|
|
responses
|
|
|
|
];
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
export HOME=$(mktemp -d);
|
|
|
|
'';
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# Tests require network access
|
|
|
|
"test_default_format"
|
|
|
|
"test_etree_default_format"
|
|
|
|
"test_etree_format_error"
|
|
|
|
"test_etree_format_happy"
|
|
|
|
"test_explicit_format"
|
|
|
|
"test_json_callback_format"
|
|
|
|
"test_json_format"
|
|
|
|
"test_parsed_json_format"
|
|
|
|
"test_walk"
|
|
|
|
"test_xmlnode_format"
|
|
|
|
"test_xmlnode_format_error"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "flickrapi" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Python interface to the Flickr API";
|
2022-04-27 09:35:20 +00:00
|
|
|
homepage = "https://stuvel.eu/flickrapi";
|
2024-09-26 11:04:55 +00:00
|
|
|
changelog = "https://github.com/sybrenstuvel/flickrapi/blob/version-${version}/CHANGELOG.md";
|
2022-04-27 09:35:20 +00:00
|
|
|
license = licenses.psfl;
|
|
|
|
maintainers = with maintainers; [ obadz ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|