nav: init at 1.2.1 (#356071)
[NixPkgs.git] / pkgs / development / python-modules / mastodon-py / default.nix
blobe8c80177cbf5a5705faec4cd37a200f974a136d2
2   lib,
3   buildPythonPackage,
4   fetchFromGitHub,
5   blurhash,
6   cryptography,
7   decorator,
8   http-ece,
9   python-dateutil,
10   python-magic,
11   requests,
12   six,
13   pytestCheckHook,
14   pytest-mock,
15   pytest-vcr,
16   requests-mock,
17   setuptools,
20 buildPythonPackage rec {
21   pname = "mastodon-py";
22   version = "1.8.1";
23   pyproject = true;
25   src = fetchFromGitHub {
26     owner = "halcy";
27     repo = "Mastodon.py";
28     rev = "refs/tags/${version}";
29     hash = "sha256-r0AAUjd2MBfZANEpyztMNyaQTlGWvWoUVjJNO1eL218=";
30   };
32   postPatch = ''
33     sed -i '/addopts/d' setup.cfg
34   '';
36   nativeBuildInputs = [ setuptools ];
38   propagatedBuildInputs = [
39     blurhash
40     decorator
41     python-dateutil
42     python-magic
43     requests
44     six
45   ];
47   optional-dependencies = {
48     blurhash = [ blurhash ];
49     webpush = [
50       http-ece
51       cryptography
52     ];
53   };
55   nativeCheckInputs = [
56     pytestCheckHook
57     pytest-mock
58     pytest-vcr
59     requests-mock
60     setuptools
61   ] ++ lib.flatten (builtins.attrValues optional-dependencies);
63   disabledTests = [
64     "test_notifications_dismiss_pre_2_9_2"
65     "test_status_card_pre_2_9_2"
66     "test_stream_user_direct"
67     "test_stream_user_local"
68   ];
70   pythonImportsCheck = [ "mastodon" ];
72   meta = with lib; {
73     changelog = "https://github.com/halcy/Mastodon.py/blob/${src.rev}/CHANGELOG.rst";
74     description = "Python wrapper for the Mastodon API";
75     homepage = "https://github.com/halcy/Mastodon.py";
76     license = licenses.mit;
77     maintainers = with maintainers; [ dotlambda ];
78   };