1{ buildPythonPackage, lib, fetchFromGitHub, glibcLocales
2, pytest, pytest-mock, gentools
3, typing, singledispatch, pythonOlder
4}:
5
6buildPythonPackage rec {
7 pname = "snug";
8 version = "1.3.4";
9
10 # Pypi doesn't ship the tests, so we fetch directly from GitHub
11 src = fetchFromGitHub {
12 owner = "ariebovenberg";
13 repo = "snug";
14 rev = "v${version}";
15 sha256 = "0jmg0sivz9ljazlnsrrqaizrb3r7asy5pa0dj3idx49gbig4589i";
16 };
17
18 # Prevent unicode decoding error in setup.py
19 # while reading README.rst and HISTORY.rst
20 buildInputs = [ glibcLocales ];
21 LC_ALL = "en_US.UTF-8";
22
23 propagatedBuildInputs =
24 lib.optionals (pythonOlder "3.4") [ singledispatch ] ++
25 lib.optionals (pythonOlder "3.5") [ typing ];
26
27 checkInputs = [ pytest pytest-mock gentools ];
28 checkPhase = "pytest";
29
30 meta = with lib; {
31 description = "Tiny toolkit for writing reusable interactions with web APIs";
32 license = licenses.mit;
33 homepage = https://snug.readthedocs.io/en/latest/;
34 maintainers = with maintainers; [ mredaelli ];
35 };
36
37}