From 11167fc4f1217f7fb29c1fdcdb696b6d0e70bb49 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Tue, 11 Jan 2022 11:56:15 +0100 Subject: [PATCH 1/2] python3Packages.cherrypy: 18.6.0 -> 18.6.1 --- .../python-modules/cherrypy/default.nix | 53 ++++++++++--------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/pkgs/development/python-modules/cherrypy/default.nix b/pkgs/development/python-modules/cherrypy/default.nix index 0c6f83ea71db..3ebebba9ecd1 100644 --- a/pkgs/development/python-modules/cherrypy/default.nix +++ b/pkgs/development/python-modules/cherrypy/default.nix @@ -1,43 +1,27 @@ -{ lib, stdenv, buildPythonPackage, fetchPypi, isPy3k +{ lib, stdenv, buildPythonPackage, fetchPypi, pythonOlder , setuptools-scm , cheroot, portend, more-itertools, zc_lockfile, routes , jaraco_collections , objgraph, pytest, pytest-cov, pathpy, requests-toolbelt, pytest-services -, fetchpatch }: buildPythonPackage rec { pname = "cherrypy"; - version = "18.6.0"; + version = "18.6.1"; + format = "setuptools"; - disabled = !isPy3k; + disabled = pythonOlder "3.7"; src = fetchPypi { pname = "CherryPy"; inherit version; - sha256 = "16f410izp2c4qhn4n3l5l3qirmkf43h2amjqms8hkl0shgfqwq2n"; + hash = "sha256-8z6HKG57PjCeBOciXY5JOC2dd3PmCSJB1/YTiTxWNJU="; }; - patches = [ - # 1/3 Fix compatibility with pytest 6. Will be part of the next release after 18.6 - (fetchpatch { - url = "https://github.com/cherrypy/cherrypy/pull/1897/commits/59c0e19d7df8680e36afc96756dce72435121448.patch"; - sha256 = "1jachbvp505gndccdhny0c3grzdrmvmbzq4kw55jx93ay94ni6p0"; - }) - # 2/3 Fix compatibility with pytest 6. Will be part of the next release after 18.6 - (fetchpatch { - url = "https://github.com/cherrypy/cherrypy/pull/1897/commits/4a6287b73539adcb7b0ae72d69644a1ced1f7eaa.patch"; - sha256 = "0nz40qmgxknkbjsdzfzcqfxdsmsxx3v104fb0h04yvs76mqvw3i4"; - }) - # 3/3 Fix compatibility with pytest 6. Will be part of the next release after 18.6 - (fetchpatch { - url = "https://github.com/cherrypy/cherrypy/commit/3bae7f06868553b006915f05ff14d86163f59a7d.patch"; - sha256 = "1z0bv23ybyw87rf1i8alsdi3gc2bzmdj9d0kjsghdkvi3zdp4n8q"; - }) + nativeBuildInputs = [ + setuptools-scm ]; - nativeBuildInputs = [ setuptools-scm ]; - propagatedBuildInputs = [ # required cheroot portend more-itertools zc_lockfile @@ -50,10 +34,10 @@ buildPythonPackage rec { objgraph pytest pytest-cov pathpy requests-toolbelt pytest-services ]; - # Keyboard interrupt ends test suite run + # daemonize and autoreload tests have issue with sockets within sandbox # Disable doctest plugin because times out - checkPhase = '' + preCheck = '' substituteInPlace pytest.ini --replace "--doctest-modules" "" pytest \ -k 'not KeyboardInterrupt and not daemonize and not Autoreload' \ @@ -63,11 +47,28 @@ buildPythonPackage rec { "--deselect=cherrypy/test/test_bus.py::BusMethodTests::test_block --deselect=cherrypy/test/test_config_server.py"} ''; + disabledTests = [ + # Keyboard interrupt ends test suite run + "" + "" + "" + "" + ]; + + disabledTestPaths = [ + "" + ]; + __darwinAllowLocalNetworking = true; + pythonImportsCheck = [ + "cherrypy" + ]; + meta = with lib; { + description = "Object-oriented HTTP framework"; homepage = "https://www.cherrypy.org"; - description = "A pythonic, object-oriented HTTP framework"; license = licenses.bsd3; + maintainers = with maintainers; [ ]; }; } From d323f67c004b6b210fd0a5013cca265615317264 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Tue, 11 Jan 2022 13:33:57 +0100 Subject: [PATCH 2/2] python3Packages.cherrypy: switch to pytestCheckHook --- .../python-modules/cherrypy/default.nix | 69 +++++++++++++------ 1 file changed, 47 insertions(+), 22 deletions(-) diff --git a/pkgs/development/python-modules/cherrypy/default.nix b/pkgs/development/python-modules/cherrypy/default.nix index 3ebebba9ecd1..01bbfe8841b7 100644 --- a/pkgs/development/python-modules/cherrypy/default.nix +++ b/pkgs/development/python-modules/cherrypy/default.nix @@ -1,8 +1,23 @@ -{ lib, stdenv, buildPythonPackage, fetchPypi, pythonOlder -, setuptools-scm -, cheroot, portend, more-itertools, zc_lockfile, routes +{ lib +, stdenv +, buildPythonPackage +, cheroot +, fetchPypi , jaraco_collections -, objgraph, pytest, pytest-cov, pathpy, requests-toolbelt, pytest-services +, more-itertools +, objgraph +, pathpy +, portend +, pytest-forked +, pytest-services +, pytestCheckHook +, pythonAtLeast +, pythonOlder +, requests-toolbelt +, routes +, setuptools-scm +, simplejson +, zc_lockfile }: buildPythonPackage rec { @@ -24,39 +39,49 @@ buildPythonPackage rec { propagatedBuildInputs = [ # required - cheroot portend more-itertools zc_lockfile + cheroot + portend + more-itertools + zc_lockfile jaraco_collections # optional routes + simplejson ]; checkInputs = [ - objgraph pytest pytest-cov pathpy requests-toolbelt pytest-services + objgraph + pathpy + pytest-forked + pytest-services + pytestCheckHook + requests-toolbelt ]; - - # daemonize and autoreload tests have issue with sockets within sandbox - # Disable doctest plugin because times out preCheck = '' - substituteInPlace pytest.ini --replace "--doctest-modules" "" - pytest \ - -k 'not KeyboardInterrupt and not daemonize and not Autoreload' \ - --deselect=cherrypy/test/test_static.py::StaticTest::test_null_bytes \ - --deselect=cherrypy/test/test_tools.py::ToolTests::testCombinedTools \ - ${lib.optionalString stdenv.isDarwin - "--deselect=cherrypy/test/test_bus.py::BusMethodTests::test_block --deselect=cherrypy/test/test_config_server.py"} + # Disable doctest plugin because times out + substituteInPlace pytest.ini \ + --replace "--doctest-modules" "-vvv" + sed -i "/--cov/d" pytest.ini ''; + pytestFlagsArray = [ + "-W" + "ignore::DeprecationWarning" + ]; + disabledTests = [ # Keyboard interrupt ends test suite run - "" - "" - "" - "" + "KeyboardInterrupt" + # daemonize and autoreload tests have issue with sockets within sandbox + "daemonize" + "Autoreload" + ] ++ lib.optionals stdenv.isDarwin [ + "test_block" ]; - disabledTestPaths = [ - "" + disabledTestPaths = lib.optionals stdenv.isDarwin [ + "cherrypy/test/test_config_server.py" ]; __darwinAllowLocalNetworking = true;