3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/python-modules/cheroot/default.nix

46 lines
1.8 KiB
Nix
Raw Normal View History

{ stdenv, fetchPypi, buildPythonPackage, pythonAtLeast
2019-07-21 10:25:00 +01: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 08:35:58 +01:00
, backports_functools_lru_cache }:
let inherit (stdenv) lib; in
buildPythonPackage rec {
pname = "cheroot";
version = "6.5.6";
src = fetchPypi {
inherit pname version;
sha256 = "b824f9961eb447809badeb051820a05770354e2f9ae5c355eecc21f22633c217";
};
patches = [ ./tests.patch ];
2019-07-21 10:25:00 +01:00
nativeBuildInputs = [ setuptools_scm setuptools-scm-git-archive ];
propagatedBuildInputs = [ more-itertools six backports_functools_lru_cache ];
2017-12-24 04:00:12 +00:00
2019-07-21 10:25:00 +01:00
checkInputs = [ pytest pytestcov portend backports_unittest-mock pytest-mock pytest-testmon pyopenssl requests trustme requests-unixsocket ];
2019-07-21 10:25:00 +01:00
# Disable doctest plugin because times out
# Disable xdist (-n arg) because it's incompatible with testmon
2019-07-21 10:25:00 +01:00
# 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
checkPhase = ''
substituteInPlace pytest.ini --replace "--doctest-modules" "" --replace "-n auto" ""
${lib.optionalString (pythonAtLeast "3.7") "sed -i '/warnings/,+2d' pytest.ini"}
2019-09-14 19:45:38 +01: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"}
'';
2019-09-16 00:37:19 +01: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;
};
}