2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, buildPythonPackage
|
2022-02-10 20:34:41 +00:00
|
|
|
, fetchPypi
|
2023-08-04 22:07:22 +00:00
|
|
|
, jaraco-functools
|
|
|
|
, jaraco-text
|
2020-07-18 16:06:22 +00:00
|
|
|
, more-itertools
|
|
|
|
, portend
|
2022-02-10 20:34:41 +00:00
|
|
|
, pypytools
|
2020-07-18 16:06:22 +00:00
|
|
|
, pytest-mock
|
2022-02-10 20:34:41 +00:00
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
2020-07-18 16:06:22 +00:00
|
|
|
, requests
|
2020-08-20 17:08:02 +00:00
|
|
|
, requests-toolbelt
|
2020-07-18 16:06:22 +00:00
|
|
|
, requests-unixsocket
|
2021-06-04 09:07:49 +00:00
|
|
|
, setuptools-scm
|
2020-07-18 16:06:22 +00:00
|
|
|
, six
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "cheroot";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "10.0.0";
|
2024-01-02 11:29:13 +00:00
|
|
|
format = "setuptools";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2023-11-16 04:20:00 +00:00
|
|
|
hash = "sha256-WcShh3/vmWmzw8CAyqrzd+J4CRlDeFP8DTKp30CzEfA=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
# remove setuptools-scm-git-archive dependency
|
|
|
|
# https://github.com/cherrypy/cheroot/commit/f0c51af263e20f332c6f675aa90ec6705ae4f5d1
|
|
|
|
# there is a difference between the github source and the pypi tarball source,
|
|
|
|
# and it is not easy to apply patches.
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace '"setuptools_scm_git_archive>=1.1",' ""
|
|
|
|
substituteInPlace setup.cfg \
|
|
|
|
--replace "setuptools_scm_git_archive>=1.0" ""
|
|
|
|
'';
|
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools-scm
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-05 17:05:55 +00:00
|
|
|
propagatedBuildInputs = [
|
2023-08-04 22:07:22 +00:00
|
|
|
jaraco-functools
|
2021-02-05 17:12:51 +00:00
|
|
|
more-itertools
|
|
|
|
six
|
2021-01-05 17:05:55 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2023-08-04 22:07:22 +00:00
|
|
|
jaraco-text
|
2020-07-18 16:06:22 +00:00
|
|
|
portend
|
2022-02-10 20:34:41 +00:00
|
|
|
pypytools
|
2020-07-18 16:06:22 +00:00
|
|
|
pytest-mock
|
2022-02-10 20:34:41 +00:00
|
|
|
pytestCheckHook
|
2020-07-18 16:06:22 +00:00
|
|
|
requests
|
2020-08-20 17:08:02 +00:00
|
|
|
requests-toolbelt
|
2020-07-18 16:06:22 +00:00
|
|
|
requests-unixsocket
|
|
|
|
];
|
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
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
disabledTests = [
|
2020-07-18 16:06:22 +00:00
|
|
|
"tls" # touches network
|
|
|
|
"peercreds_unix_sock" # test urls no longer allowed
|
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
"http_over_https_error"
|
|
|
|
"bind_addr_unix"
|
2022-05-18 14:49:53 +00:00
|
|
|
"test_ssl_env"
|
2020-07-18 16:06:22 +00:00
|
|
|
];
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
disabledTestPaths = [
|
2021-02-05 17:12:51 +00:00
|
|
|
# avoid attempting to use 3 packages not available on nixpkgs
|
|
|
|
# (jaraco.apt, jaraco.context, yg.lockfile)
|
|
|
|
"cheroot/test/test_wsgi.py"
|
2022-08-12 12:06:08 +00:00
|
|
|
# requires pyopenssl
|
|
|
|
"cheroot/test/test_ssl.py"
|
2021-02-05 17:12:51 +00:00
|
|
|
];
|
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"cheroot"
|
|
|
|
];
|
|
|
|
|
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";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "cheroot";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/cherrypy/cheroot";
|
|
|
|
license = licenses.mit;
|
2022-02-10 20:34:41 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|