2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
blurhash,
|
|
|
|
cryptography,
|
|
|
|
decorator,
|
|
|
|
http-ece,
|
|
|
|
python-dateutil,
|
|
|
|
python-magic,
|
|
|
|
requests,
|
|
|
|
six,
|
|
|
|
pytestCheckHook,
|
|
|
|
pytest-mock,
|
|
|
|
pytest-vcr,
|
|
|
|
requests-mock,
|
|
|
|
setuptools,
|
2021-06-28 23:13:55 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "mastodon-py";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "1.8.1";
|
2023-11-16 04:20:00 +00:00
|
|
|
pyproject = true;
|
2021-06-28 23:13:55 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "halcy";
|
|
|
|
repo = "Mastodon.py";
|
2022-11-21 17:40:18 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2023-07-15 17:15:38 +00:00
|
|
|
hash = "sha256-r0AAUjd2MBfZANEpyztMNyaQTlGWvWoUVjJNO1eL218=";
|
2021-06-28 23:13:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
2023-11-16 04:20:00 +00:00
|
|
|
sed -i '/addopts/d' setup.cfg
|
2021-06-28 23:13:55 +00:00
|
|
|
'';
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeBuildInputs = [ setuptools ];
|
2023-11-16 04:20:00 +00:00
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
blurhash
|
|
|
|
decorator
|
|
|
|
python-dateutil
|
2022-05-18 14:49:53 +00:00
|
|
|
python-magic
|
2021-06-28 23:13:55 +00:00
|
|
|
requests
|
|
|
|
six
|
|
|
|
];
|
|
|
|
|
2024-10-04 16:56:33 +00:00
|
|
|
optional-dependencies = {
|
2024-06-05 15:53:02 +00:00
|
|
|
blurhash = [ blurhash ];
|
2023-11-16 04:20:00 +00:00
|
|
|
webpush = [
|
|
|
|
http-ece
|
|
|
|
cryptography
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-06-28 23:13:55 +00:00
|
|
|
pytestCheckHook
|
|
|
|
pytest-mock
|
|
|
|
pytest-vcr
|
|
|
|
requests-mock
|
2023-11-16 04:20:00 +00:00
|
|
|
setuptools
|
2024-10-04 16:56:33 +00:00
|
|
|
] ++ lib.flatten (builtins.attrValues optional-dependencies);
|
2023-11-16 04:20:00 +00:00
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
"test_notifications_dismiss_pre_2_9_2"
|
|
|
|
"test_status_card_pre_2_9_2"
|
|
|
|
"test_stream_user_direct"
|
|
|
|
"test_stream_user_local"
|
2021-06-28 23:13:55 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "mastodon" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
2022-12-17 10:02:37 +00:00
|
|
|
changelog = "https://github.com/halcy/Mastodon.py/blob/${src.rev}/CHANGELOG.rst";
|
2021-06-28 23:13:55 +00:00
|
|
|
description = "Python wrapper for the Mastodon API";
|
|
|
|
homepage = "https://github.com/halcy/Mastodon.py";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ dotlambda ];
|
|
|
|
};
|
|
|
|
}
|