summary refs log tree commit diff
path: root/pkgs/development/python-modules/snug/default.nix
blob: a697ed0161a04e0e7cd87ce233b4ec9fd975e636 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{ buildPythonPackage, lib, fetchFromGitHub, glibcLocales
, pytest, pytest-mock, gentools
, typing, singledispatch, pythonOlder
, isPy3k
}:

buildPythonPackage rec {
  pname = "snug";
  version = "1.3.4";
  disabled = isPy3k;

  # Pypi doesn't ship the tests, so we fetch directly from GitHub
  src = fetchFromGitHub {
    owner = "ariebovenberg";
    repo = "snug";
    rev = "v${version}";
    sha256 = "0jmg0sivz9ljazlnsrrqaizrb3r7asy5pa0dj3idx49gbig4589i";
  };

  # Prevent unicode decoding error in setup.py
  # while reading README.rst and HISTORY.rst
  buildInputs = [ glibcLocales ];
  LC_ALL = "en_US.UTF-8";

  propagatedBuildInputs =
    lib.optionals (pythonOlder "3.4") [ singledispatch ] ++
    lib.optionals (pythonOlder "3.5") [ typing ];

  checkInputs = [ pytest pytest-mock gentools ];
  checkPhase = "pytest";

  meta = with lib; {
    description = "Tiny toolkit for writing reusable interactions with web APIs";
    license = licenses.mit;
    homepage = https://snug.readthedocs.io/en/latest/;
    maintainers = with maintainers; [ mredaelli ];
  };

}