2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
fetchpatch,
|
|
|
|
filetype,
|
|
|
|
future,
|
|
|
|
hypothesis,
|
|
|
|
lib,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
|
|
|
requests,
|
|
|
|
requests-oauthlib,
|
|
|
|
responses,
|
|
|
|
setuptools,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "python-twitter";
|
|
|
|
version = "3.5";
|
2024-06-05 15:53:02 +00:00
|
|
|
|
|
|
|
pyproject = true;
|
|
|
|
build-system = [ setuptools ];
|
2022-04-27 09:35:20 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "bear";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "08ydmf6dcd416cvw6xq1wxsz6b9s21f2mf9fh3y4qz9swj6n9h8z";
|
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
# Fix tests. Remove with the next release
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/bear/python-twitter/commit/f7eb83d9dca3ba0ee93e629ba5322732f99a3a30.patch";
|
|
|
|
sha256 = "008b1bd03wwngs554qb136lsasihql3yi7vlcacmk4s5fmr6klqw";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
dependencies = [
|
2022-04-27 09:35:20 +00:00
|
|
|
filetype
|
|
|
|
future
|
|
|
|
requests
|
|
|
|
requests-oauthlib
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-04-27 09:35:20 +00:00
|
|
|
pytestCheckHook
|
|
|
|
responses
|
|
|
|
hypothesis
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py \
|
2024-09-19 14:19:46 +00:00
|
|
|
--replace-fail "'pytest-runner'" ""
|
2022-04-27 09:35:20 +00:00
|
|
|
'';
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
disabledTests = [
|
|
|
|
# AttributeError: 'FileCacheTest' object has no attribute 'assert_'
|
|
|
|
"test_filecache"
|
2022-04-27 09:35:20 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "twitter" ];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2022-04-27 09:35:20 +00:00
|
|
|
description = "Python wrapper around the Twitter API";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/bear/python-twitter";
|
|
|
|
license = licenses.asl20;
|
2024-05-15 15:35:15 +00:00
|
|
|
maintainers = [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|