From ebb7b9b772cf1bbb4a436d57e39e3741f29e10dc Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Wed, 24 Jan 2024 13:12:23 +0200 Subject: [PATCH 1/2] python311Packages.rpyc4: init at 4.1.5 This version is required for linien-common, due to RedPitaya OS Python version limitation. See: https://github.com/linien-org/pyrp3/pull/10#discussion_r1302816237 --- .../python-modules/rpyc4/default.nix | 74 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 76 insertions(+) create mode 100644 pkgs/development/python-modules/rpyc4/default.nix diff --git a/pkgs/development/python-modules/rpyc4/default.nix b/pkgs/development/python-modules/rpyc4/default.nix new file mode 100644 index 000000000000..c883ebef4dc6 --- /dev/null +++ b/pkgs/development/python-modules/rpyc4/default.nix @@ -0,0 +1,74 @@ +{ lib +, stdenv +, buildPythonPackage +, fetchFromGitHub +, setuptools +, hatchling +, plumbum +, pytestCheckHook +, pythonOlder +, pythonAtLeast +}: + +buildPythonPackage rec { + pname = "rpyc4"; + # Pinned version for linien, see also: + # https://github.com/linien-org/pyrp3/pull/10#discussion_r1302816237 + version = "4.1.5"; + format = "pyproject"; + + # Since this is an outdated version, upstream might have fixed the + # compatibility issues with Python3.12, but we can't enjoy them yet. + disabled = pythonOlder "3.7" || pythonAtLeast "3.12"; + + src = fetchFromGitHub { + owner = "tomerfiliba"; + repo = "rpyc"; + rev = version; + hash = "sha256-8NOcXZDR3w0TNj1+LZ7lzQAt7yDgspjOp2zk1bsbVls="; + }; + + nativeBuildInputs = [ + setuptools + hatchling + ]; + + propagatedBuildInputs = [ + plumbum + ]; + + nativeCheckInputs = [ + pytestCheckHook + ]; + + disabledTests = [ + # Disable tests that requires network access + "test_api" + "test_close_timeout" + "test_deploy" + "test_listing" + "test_pruning" + "test_rpyc" + # Test is outdated + # ssl.SSLError: [SSL: NO_CIPHERS_AVAILABLE] no ciphers available (_ssl.c:997) + "test_ssl_conenction" + ]; + disabledTestPaths = [ + "tests/test_ssh.py" + "tests/test_teleportation.py" + ]; + + pythonImportsCheck = [ + "rpyc" + ]; + + doCheck = !stdenv.isDarwin; + + meta = with lib; { + description = "Remote Python Call (RPyC), a transparent and symmetric RPC library"; + homepage = "https://rpyc.readthedocs.org"; + changelog = "https://github.com/tomerfiliba-org/rpyc/blob/${version}/CHANGELOG.rst"; + license = with licenses; [ mit ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 6375fac04d61..6f6b77b490c1 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -12774,6 +12774,8 @@ self: super: with self; { rpyc = callPackage ../development/python-modules/rpyc { }; + rpyc4 = callPackage ../development/python-modules/rpyc4 { }; + rq = callPackage ../development/python-modules/rq { }; rsa = callPackage ../development/python-modules/rsa { }; From c332a23b7b6111e3106f46495ef4c40ce85797f9 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Wed, 24 Jan 2024 13:17:19 +0200 Subject: [PATCH 2/2] python311Packages.linien-common: fix build by using rpyc4 --- pkgs/development/python-modules/linien-common/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/linien-common/default.nix b/pkgs/development/python-modules/linien-common/default.nix index de05fab7f74d..605fdd6f740e 100644 --- a/pkgs/development/python-modules/linien-common/default.nix +++ b/pkgs/development/python-modules/linien-common/default.nix @@ -4,7 +4,7 @@ , setuptools , importlib-metadata , numpy -, rpyc +, rpyc4 , scipy , appdirs , callPackage @@ -33,7 +33,7 @@ buildPythonPackage rec { propagatedBuildInputs = [ importlib-metadata numpy - rpyc + rpyc4 scipy appdirs ];