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