From 0e6166eaf82f8388622bb4dd4d6630c9aa5a0ba8 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Thu, 5 Dec 2024 10:07:59 +0100 Subject: [PATCH] python312Packages.softlayer: fix on darwin --- .../python-modules/softlayer/default.nix | 49 ++++++++++++------- 1 file changed, 31 insertions(+), 18 deletions(-) diff --git a/pkgs/development/python-modules/softlayer/default.nix b/pkgs/development/python-modules/softlayer/default.nix index b2238da2916f..49550048e359 100644 --- a/pkgs/development/python-modules/softlayer/default.nix +++ b/pkgs/development/python-modules/softlayer/default.nix @@ -1,44 +1,52 @@ { lib, + stdenv, buildPythonPackage, - click, fetchFromGitHub, - mock, + + # build-system + setuptools, + + # dependencies + click, prettytable, prompt-toolkit, ptable, pygments, - pytestCheckHook, - pythonOlder, requests, rich, + urllib3, + + # tests + mock, + pytestCheckHook, sphinx, testtools, tkinter, - urllib3, zeep, }: buildPythonPackage rec { pname = "softlayer"; version = "6.2.5"; - format = "setuptools"; - - disabled = pythonOlder "3.7"; + pyproject = true; src = fetchFromGitHub { - owner = pname; + owner = "softlayer"; repo = "softlayer-python"; - rev = "refs/tags/v${version}"; + tag = "v${version}"; hash = "sha256-wDLMVonPUexoaZ60kRBILmr5l46yajzACozCp6uETGY="; }; - postPatch = '' - substituteInPlace setup.py \ - --replace "rich ==" "rich >=" - ''; + build-system = [ + setuptools + ]; - propagatedBuildInputs = [ + pythonRelaxDeps = [ + "rich" + ]; + + dependencies = [ click prettytable prompt-toolkit @@ -66,6 +74,11 @@ buildPythonPackage rec { export HOME=$(mktemp -d) ''; + pytestFlagsArray = lib.optionals stdenv.hostPlatform.isDarwin [ + # SoftLayer.exceptions.TransportError: TransportError(0): ('Connection aborted.', ConnectionResetError(54, 'Connection reset by peer')) + "--deselect=tests/CLI/modules/hardware/hardware_basic_tests.py::HardwareCLITests" + ]; + disabledTestPaths = [ # Test fails with ConnectionError trying to connect to api.softlayer.com "tests/transports/soap_tests.py.unstable" @@ -73,11 +86,11 @@ buildPythonPackage rec { pythonImportsCheck = [ "SoftLayer" ]; - meta = with lib; { + meta = { description = "Python libraries that assist in calling the SoftLayer API"; homepage = "https://github.com/softlayer/softlayer-python"; changelog = "https://github.com/softlayer/softlayer-python/releases/tag/v${version}"; - license = licenses.mit; - maintainers = with maintainers; [ onny ]; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ onny ]; }; }