Merge pull request #307098 from r-ryantm/auto-update/cilium-cli
[NixPkgs.git] / pkgs / development / python-modules / cherrypy / default.nix
blob6d1fffbdedc95e27e29b8bc38ce6ea9fc5a98d71
1 { lib
2 , stdenv
3 , buildPythonPackage
4 , cheroot
5 , fetchpatch
6 , fetchPypi
7 , jaraco-collections
8 , more-itertools
9 , objgraph
10 , path
11 , portend
12 , pyopenssl
13 , pytest-forked
14 , pytest-services
15 , pytestCheckHook
16 , python-memcached
17 , pythonAtLeast
18 , pythonOlder
19 , requests-toolbelt
20 , routes
21 , setuptools-scm
22 , simplejson
23 , zc-lockfile
26 buildPythonPackage rec {
27   pname = "cherrypy";
28   version = "18.9.0";
29   pyproject = true;
31   disabled = pythonOlder "3.7";
33   src = fetchPypi {
34     pname = "CherryPy";
35     inherit version;
36     hash = "sha256-awbBkc5xqGRh8wVyoatX/8CfQxQ7qOQsEDx7M0ciDrE=";
37   };
39   patches = [
40     # Replace distutils.spawn.find_executable with shutil.which, https://github.com/cherrypy/cherrypy/pull/2023
41     (fetchpatch {
42       name = "remove-distutils.patch";
43       url = "https://github.com/cherrypy/cherrypy/commit/8a19dd5f1e712a326a3613b17e6fc900012ed09a.patch";
44       hash = "sha256-fXECX0CdU74usiq9GEkIG9CF+dueszblT4qOeF6B700=";
45     })
46   ];
48   postPatch = ''
49     substituteInPlace pyproject.toml \
50       --replace-fail '"setuptools_scm_git_archive >= 1.1",' ""
51     # Disable doctest plugin because times out
52     substituteInPlace pytest.ini \
53       --replace-fail "--doctest-modules" "-vvv" \
54       --replace-fail "-p pytest_cov" "" \
55       --replace-fail "--no-cov-on-fail" ""
56     sed -i "/--cov/d" pytest.ini
57   '';
59   nativeBuildInputs = [
60     setuptools-scm
61   ];
63   propagatedBuildInputs = [
64     cheroot
65     jaraco-collections
66     more-itertools
67     portend
68     zc-lockfile
69   ];
71   nativeCheckInputs = [
72     objgraph
73     path
74     pytest-forked
75     pytest-services
76     pytestCheckHook
77     requests-toolbelt
78   ];
80   preCheck = ''
81     export CI=true
82   '';
84   pytestFlagsArray = [
85     "-W"
86     "ignore::DeprecationWarning"
87   ];
89   disabledTests = [
90     # Keyboard interrupt ends test suite run
91     "KeyboardInterrupt"
92     # daemonize and autoreload tests have issue with sockets within sandbox
93     "daemonize"
94     "Autoreload"
96     "test_antistampede"
97     "test_file_stream"
98     "test_basic_request"
99     "test_3_Redirect"
100     "test_4_File_deletion"
101   ] ++ lib.optionals (pythonAtLeast "3.11") [
102     "testErrorHandling"
103     "testHookErrors"
104     "test_HTTP10_KeepAlive"
105     "test_No_Message_Body"
106     "test_HTTP11_Timeout"
107     "testGzip"
108     "test_malformed_header"
109     "test_no_content_length"
110     "test_post_filename_with_special_characters"
111     "test_post_multipart"
112     "test_iterator"
113     "test_1_Ram_Concurrency"
114     "test_2_File_Concurrency"
115   ] ++ lib.optionals stdenv.isDarwin [
116     "test_block"
117   ];
119   disabledTestPaths = lib.optionals stdenv.isDarwin [
120     "cherrypy/test/test_config_server.py"
121   ];
123   __darwinAllowLocalNetworking = true;
125   pythonImportsCheck = [
126     "cherrypy"
127   ];
129   passthru.optional-dependencies = {
130     json = [ simplejson ];
131     memcached_session = [ python-memcached ];
132     routes_dispatcher = [ routes ];
133     ssl = [ pyopenssl ];
134     # not packaged yet
135     xcgi = [ /* flup */ ];
136   };
138   meta = with lib; {
139     description = "Object-oriented HTTP framework";
140     mainProgram = "cherryd";
141     homepage = "https://cherrypy.dev/";
142     changelog = "https://github.com/cherrypy/cherrypy/blob/v${version}/CHANGES.rst";
143     license = licenses.bsd3;
144     maintainers = with maintainers; [ ];
145   };