1{ stdenv, fetchPypi, buildPythonPackage, fetchpatch
2, more-itertools, six
3, pytest, pytestcov, portend
4, backports_unittest-mock
5, backports_functools_lru_cache }:
6
7buildPythonPackage rec {
8 pname = "cheroot";
9 version = "6.3.3";
10
11 src = fetchPypi {
12 inherit pname version;
13 sha256 = "8e3ac15e1efffc81425a693e99b3c09d7ea4bf947255d8d4c38e2cf76f3a4d25";
14 };
15
16 patches = fetchpatch {
17 name = "cheroot-fix-setup-python3.patch";
18 url = "https://git.archlinux.org/svntogit/community.git/plain/trunk/cheroot-fix-setup-python3.patch?h=packages/python-cheroot";
19 sha256 = "1rlgz0qln536y00mfqlf0i9hz3f53id73wh47cg5q2vcsw1w2bpc";
20 };
21
22 propagatedBuildInputs = [ more-itertools six backports_functools_lru_cache ];
23
24 checkInputs = [ pytest pytestcov portend backports_unittest-mock ];
25
26# Disable testmon, it needs pytest-testmon, which we do not currently have in nikpkgs,
27# and is only used to skip some tests that are already known to work.
28 postPatch = ''
29 substituteInPlace "./pytest.ini" --replace "--testmon" ""
30 substituteInPlace setup.py --replace "use_scm_version=True" "version=\"${version}\"" \
31 --replace "'setuptools_scm>=1.15.0'," "" \
32 --replace "'setuptools_scm_git_archive>=1.0'," "" \
33 '';
34
35 checkPhase = ''
36 py.test cheroot
37 '';
38
39 meta = with stdenv.lib; {
40 description = "High-performance, pure-Python HTTP";
41 homepage = https://github.com/cherrypy/cheroot;
42 license = licenses.mit;
43 };
44}