2019-11-27 21:05:34 +01:00
|
|
|
{ stdenv, fetchPypi, buildPythonPackage, pythonAtLeast, isPy3k
|
2019-07-21 11:25:00 +02:00
|
|
|
, more-itertools, six, setuptools_scm, setuptools-scm-git-archive
|
|
|
|
, pytest, pytestcov, portend, pytest-testmon, pytest-mock
|
|
|
|
, backports_unittest-mock, pyopenssl, requests, trustme, requests-unixsocket
|
2018-06-28 09:35:58 +02:00
|
|
|
, backports_functools_lru_cache }:
|
2017-09-05 11:16:41 +02:00
|
|
|
|
2019-08-22 15:18:12 +02:00
|
|
|
let inherit (stdenv) lib; in
|
|
|
|
|
2017-09-05 11:16:41 +02:00
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "cheroot";
|
2019-10-24 08:47:27 +02:00
|
|
|
version = "8.2.1";
|
2017-09-05 11:16:41 +02:00
|
|
|
|
2019-11-27 21:05:34 +01:00
|
|
|
disabled = !isPy3k;
|
|
|
|
|
2017-09-05 11:16:41 +02:00
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2019-10-24 08:47:27 +02:00
|
|
|
sha256 = "5b525b3e4a755adf78070ab54c1821fb860d4255a9317dba2b88eb2df2441cff";
|
2017-09-05 11:16:41 +02:00
|
|
|
};
|
|
|
|
|
2019-07-21 11:25:00 +02:00
|
|
|
nativeBuildInputs = [ setuptools_scm setuptools-scm-git-archive ];
|
2018-07-30 07:50:54 +02:00
|
|
|
|
|
|
|
propagatedBuildInputs = [ more-itertools six backports_functools_lru_cache ];
|
2017-12-24 05:00:12 +01:00
|
|
|
|
2019-07-21 11:25:00 +02:00
|
|
|
checkInputs = [ pytest pytestcov portend backports_unittest-mock pytest-mock pytest-testmon pyopenssl requests trustme requests-unixsocket ];
|
2017-09-05 11:16:41 +02:00
|
|
|
|
2019-07-21 11:25:00 +02:00
|
|
|
# Disable doctest plugin because times out
|
2019-08-22 15:18:12 +02:00
|
|
|
# Disable xdist (-n arg) because it's incompatible with testmon
|
2019-07-21 11:25:00 +02:00
|
|
|
# Deselect test_bind_addr_unix on darwin because times out
|
|
|
|
# Deselect test_http_over_https_error on darwin because builtin cert fails
|
2019-08-22 15:18:12 +02:00
|
|
|
# Disable warnings-as-errors because of deprecation warnings from socks on python 3.7
|
2017-09-05 11:16:41 +02:00
|
|
|
checkPhase = ''
|
2019-08-22 15:18:12 +02:00
|
|
|
substituteInPlace pytest.ini --replace "--doctest-modules" "" --replace "-n auto" ""
|
|
|
|
${lib.optionalString (pythonAtLeast "3.7") "sed -i '/warnings/,+2d' pytest.ini"}
|
2019-09-14 20:45:38 +02:00
|
|
|
pytest -k 'not tls' ${lib.optionalString stdenv.isDarwin "--deselect=cheroot/test/test_ssl.py::test_http_over_https_error --deselect=cheroot/test/test_server.py::test_bind_addr_unix"}
|
2017-09-05 11:16:41 +02:00
|
|
|
'';
|
|
|
|
|
2019-09-16 01:37:19 +02:00
|
|
|
# Some of the tests use localhost networking.
|
|
|
|
__darwinAllowLocalNetworking = true;
|
|
|
|
|
2019-08-22 15:18:12 +02:00
|
|
|
meta = with lib; {
|
2017-09-05 11:16:41 +02:00
|
|
|
description = "High-performance, pure-Python HTTP";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://github.com/cherrypy/cheroot";
|
2017-09-05 11:16:41 +02:00
|
|
|
license = licenses.mit;
|
|
|
|
};
|
|
|
|
}
|