2020-07-18 16:06:22 +00:00
|
|
|
{ lib, stdenv, fetchPypi, buildPythonPackage, isPy3k
|
|
|
|
, jaraco_text
|
|
|
|
, more-itertools
|
|
|
|
, portend
|
|
|
|
, pyopenssl
|
|
|
|
, pytestCheckHook
|
|
|
|
, pytestcov
|
|
|
|
, pytest-mock
|
|
|
|
, requests
|
2020-08-20 17:08:02 +00:00
|
|
|
, requests-toolbelt
|
2020-07-18 16:06:22 +00:00
|
|
|
, requests-unixsocket
|
|
|
|
, setuptools_scm
|
|
|
|
, setuptools-scm-git-archive
|
|
|
|
, six
|
|
|
|
, trustme
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "cheroot";
|
2020-12-07 07:45:13 +00:00
|
|
|
version = "8.4.8";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
disabled = !isPy3k;
|
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2020-12-07 07:45:13 +00:00
|
|
|
sha256 = "1089c28a9c320d19fdf9a4b0ed6ace23a0948db1c171a36ac985f3741bc62865";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ setuptools_scm setuptools-scm-git-archive ];
|
|
|
|
|
2020-07-18 16:06:22 +00:00
|
|
|
propagatedBuildInputs = [ more-itertools six ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-07-18 16:06:22 +00:00
|
|
|
checkInputs = [
|
|
|
|
jaraco_text
|
|
|
|
portend
|
|
|
|
pyopenssl
|
|
|
|
pytestCheckHook
|
|
|
|
pytestcov
|
|
|
|
pytest-mock
|
|
|
|
requests
|
2020-08-20 17:08:02 +00:00
|
|
|
requests-toolbelt
|
2020-07-18 16:06:22 +00:00
|
|
|
requests-unixsocket
|
|
|
|
trustme
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
# avoid attempting to use 3 packages not available on nixpkgs
|
|
|
|
# (jaraco.apt, jaraco.context, yg.lockfile)
|
|
|
|
pytestFlagsArray = [ "--ignore=cheroot/test/test_wsgi.py" ];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
# Disable doctest plugin because times out
|
|
|
|
# Disable xdist (-n arg) because it's incompatible with testmon
|
|
|
|
# Deselect test_bind_addr_unix on darwin because times out
|
|
|
|
# Deselect test_http_over_https_error on darwin because builtin cert fails
|
|
|
|
# Disable warnings-as-errors because of deprecation warnings from socks on python 3.7
|
2020-12-07 07:45:13 +00:00
|
|
|
# Disable pytest-testmon because it doesn't work
|
2020-07-18 16:06:22 +00:00
|
|
|
# adds many other pytest utilities which aren't necessary like linting
|
|
|
|
preCheck = ''
|
|
|
|
rm pytest.ini
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2020-07-18 16:06:22 +00:00
|
|
|
disabledTests= [
|
|
|
|
"tls" # touches network
|
|
|
|
"peercreds_unix_sock" # test urls no longer allowed
|
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
"http_over_https_error"
|
|
|
|
"bind_addr_unix"
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
# Some of the tests use localhost networking.
|
|
|
|
__darwinAllowLocalNetworking = true;
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "High-performance, pure-Python HTTP";
|
|
|
|
homepage = "https://github.com/cherrypy/cheroot";
|
|
|
|
license = licenses.mit;
|
|
|
|
};
|
|
|
|
}
|