From 1fd9c06c6e7d90c41484d0bc941ef77efc4da495 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sun, 11 Feb 2024 21:59:22 -0800 Subject: [PATCH 1/4] python312Packages.paho-mqtt_2: init at 2.1.0 https://github.com/eclipse/paho.mqtt.python/compare/v1.6.1...v2.1.0 https://github.com/eclipse/paho.mqtt.python/blob/v2.1.0/ChangeLog.txt The ecosystem is still too fragile to promote paho-mqtt 2.x to the version used in the python package set, but we can provide 2.x for applications in nixpkgs. Co-Authored-By: Robert Scott Co-Authored-By: Martin Weinelt --- .../python-modules/paho-mqtt/1.nix | 42 +++++++++++++++++++ .../python-modules/paho-mqtt/default.nix | 41 +++++++++++++----- pkgs/top-level/python-packages.nix | 4 +- 3 files changed, 75 insertions(+), 12 deletions(-) create mode 100644 pkgs/development/python-modules/paho-mqtt/1.nix diff --git a/pkgs/development/python-modules/paho-mqtt/1.nix b/pkgs/development/python-modules/paho-mqtt/1.nix new file mode 100644 index 0000000000000..83582102767b8 --- /dev/null +++ b/pkgs/development/python-modules/paho-mqtt/1.nix @@ -0,0 +1,42 @@ +{ + lib, + stdenv, + buildPythonPackage, + fetchFromGitHub, + isPy3k, + pytestCheckHook, + mock, + six, +}: + +buildPythonPackage rec { + pname = "paho-mqtt"; + version = "1.6.1"; + format = "setuptools"; + + src = fetchFromGitHub { + owner = "eclipse"; + repo = "paho.mqtt.python"; + rev = "v${version}"; + hash = "sha256-9nH6xROVpmI+iTKXfwv2Ar1PAmWbEunI3HO0pZyK6Rg="; + }; + + nativeCheckInputs = [ + pytestCheckHook + six + ] ++ lib.optionals (!isPy3k) [ mock ]; + + doCheck = !stdenv.isDarwin; + + pythonImportsCheck = [ "paho.mqtt" ]; + + meta = with lib; { + description = "MQTT version 3.1.1 client class"; + homepage = "https://eclipse.org/paho"; + license = licenses.epl10; + maintainers = with maintainers; [ + mog + dotlambda + ]; + }; +} diff --git a/pkgs/development/python-modules/paho-mqtt/default.nix b/pkgs/development/python-modules/paho-mqtt/default.nix index 83582102767b8..437aa9884beb0 100644 --- a/pkgs/development/python-modules/paho-mqtt/default.nix +++ b/pkgs/development/python-modules/paho-mqtt/default.nix @@ -2,38 +2,57 @@ lib, stdenv, buildPythonPackage, + pythonOlder, fetchFromGitHub, - isPy3k, + hatchling, pytestCheckHook, - mock, - six, }: -buildPythonPackage rec { +let + testing = fetchFromGitHub { + owner = "eclipse"; + repo = "paho.mqtt.testing"; + rev = "a4dc694010217b291ee78ee13a6d1db812f9babd"; + hash = "sha256-SQoNdkWMjnasPjpXQF2yV97MUra8gb27pc3rNoA8Rjw="; + }; +in buildPythonPackage rec { pname = "paho-mqtt"; - version = "1.6.1"; - format = "setuptools"; + version = "2.1.0"; + pyproject = true; + + disabled = pythonOlder "3.7"; src = fetchFromGitHub { owner = "eclipse"; repo = "paho.mqtt.python"; rev = "v${version}"; - hash = "sha256-9nH6xROVpmI+iTKXfwv2Ar1PAmWbEunI3HO0pZyK6Rg="; + hash = "sha256-VMq+WTW+njK34QUUTE6fR2j2OmHxVzR0wrC92zYb1rY="; }; + build-system = [ + hatchling + ]; + nativeCheckInputs = [ pytestCheckHook - six - ] ++ lib.optionals (!isPy3k) [ mock ]; + ]; doCheck = !stdenv.isDarwin; pythonImportsCheck = [ "paho.mqtt" ]; + preCheck = '' + ln -s ${testing} paho.mqtt.testing + + # paho.mqtt not in top-level dir to get caught by this + export PYTHONPATH=".:$PYTHONPATH" + ''; + meta = with lib; { - description = "MQTT version 3.1.1 client class"; + changelog = "https://github.com/eclipse/paho.mqtt.python/blob/${src.rev}/ChangeLog.txt"; + description = "MQTT version 5.0/3.1.1 client class"; homepage = "https://eclipse.org/paho"; - license = licenses.epl10; + license = licenses.epl20; maintainers = with maintainers; [ mog dotlambda diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 983d0d25bb970..37953d595ed4d 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -9555,7 +9555,9 @@ self: super: with self; { paginate = callPackage ../development/python-modules/paginate { }; - paho-mqtt = callPackage ../development/python-modules/paho-mqtt { }; + paho-mqtt_1 = callPackage ../development/python-modules/paho-mqtt/1.nix { }; + paho-mqtt_2 = callPackage ../development/python-modules/paho-mqtt/default.nix { }; + paho-mqtt = paho-mqtt_1; palace = callPackage ../development/python-modules/palace { }; From 304a034d330c7913c78c97540c08a1f5c52e16ca Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sun, 7 Jul 2024 16:33:48 +0200 Subject: [PATCH 2/4] python312Packages.aiomysensors: drop Unused leaf dependency preventing us from removing asyncio-mqtt, which was renamed to aiomqtt a few release ago. --- .../python-modules/aiomysensors/default.nix | 62 ------------------- pkgs/top-level/python-aliases.nix | 1 + pkgs/top-level/python-packages.nix | 2 - 3 files changed, 1 insertion(+), 64 deletions(-) delete mode 100644 pkgs/development/python-modules/aiomysensors/default.nix diff --git a/pkgs/development/python-modules/aiomysensors/default.nix b/pkgs/development/python-modules/aiomysensors/default.nix deleted file mode 100644 index f23adad066628..0000000000000 --- a/pkgs/development/python-modules/aiomysensors/default.nix +++ /dev/null @@ -1,62 +0,0 @@ -{ - lib, - aiofiles, - asyncio-mqtt, - awesomeversion, - buildPythonPackage, - click, - fetchFromGitHub, - marshmallow, - poetry-core, - pyserial-asyncio, - pytest-asyncio, - pytestCheckHook, - pythonOlder, -}: - -buildPythonPackage rec { - pname = "aiomysensors"; - version = "0.3.16"; - pyproject = true; - - disabled = pythonOlder "3.9"; - - src = fetchFromGitHub { - owner = "MartinHjelmare"; - repo = "aiomysensors"; - rev = "refs/tags/v${version}"; - hash = "sha256-1BpmjCgKiCZmBpBENlg79+I3UhkIxrgLAUD8ixpGUM8="; - }; - - postPatch = '' - substituteInPlace pyproject.toml \ - --replace-fail " --cov=src --cov-report=term-missing:skip-covered" "" - ''; - - build-system = [ poetry-core ]; - - dependencies = [ - aiofiles - asyncio-mqtt - awesomeversion - click - marshmallow - pyserial-asyncio - ]; - - nativeCheckInputs = [ - pytest-asyncio - pytestCheckHook - ]; - - pythonImportsCheck = [ "aiomysensors" ]; - - meta = with lib; { - description = "Library to connect to MySensors gateways"; - homepage = "https://github.com/MartinHjelmare/aiomysensors"; - changelog = "https://github.com/MartinHjelmare/aiomysensors/releases/tag/v${version}"; - license = with licenses; [ asl20 ]; - maintainers = with maintainers; [ fab ]; - mainProgram = "aiomysensors"; - }; -} diff --git a/pkgs/top-level/python-aliases.nix b/pkgs/top-level/python-aliases.nix index e0e30fa1b1e6c..ea0931d50b0db 100644 --- a/pkgs/top-level/python-aliases.nix +++ b/pkgs/top-level/python-aliases.nix @@ -37,6 +37,7 @@ mapAliases ({ acebinf = throw "acebinf has been removed because it is abandoned and broken."; # Added 2023-05-19 adafruit-nrfutil = throw "adafruit-nrfutil has been promoted to a top-level attribute name: `pkgs.adafruit-nrfutil`."; # Added 2023-11-19 aioaladdinconnect = throw "aioaladdinconnect has been removed, as the API is supported was obsoleted on 2024-01-24."; # Added 2024-06-07 + aiomysensors = throw "aiomysensors has been removed, as it was packaged for Home Assistant, which migrated to pymysensors."; # Added 2024-07-07 aioh2 = throw "aioh2 has been removed because it is abandoned and broken."; # Added 2022-03-30 aionotify = throw "aionotify has been removed because is unmaintained and incompatible with python3.11."; # Added 2023-10-27 aiosenseme = throw "aiosenseme has been removed, because it does no longer work with the latest firmware and has become unmaintained"; # Added 2023-07-05 diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 37953d595ed4d..d15a274088992 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -329,8 +329,6 @@ self: super: with self; { aiomusiccast = callPackage ../development/python-modules/aiomusiccast { }; - aiomysensors = callPackage ../development/python-modules/aiomysensors { }; - aiomysql = callPackage ../development/python-modules/aiomysql { }; aionanoleaf = callPackage ../development/python-modules/aionanoleaf { }; From 5d9ae17b849d286a3bb2fd7cfd3052ee84c286fc Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sun, 7 Jul 2024 16:36:03 +0200 Subject: [PATCH 3/4] python312Packages.asyncio-mqtt: drop The project was renamed to aiomqtt back in 2023/07. With the last consumer of it gone, we can retire it. --- .../python-modules/asyncio-mqtt/default.nix | 71 ------------------- pkgs/top-level/python-aliases.nix | 1 + pkgs/top-level/python-packages.nix | 2 - 3 files changed, 1 insertion(+), 73 deletions(-) delete mode 100644 pkgs/development/python-modules/asyncio-mqtt/default.nix diff --git a/pkgs/development/python-modules/asyncio-mqtt/default.nix b/pkgs/development/python-modules/asyncio-mqtt/default.nix deleted file mode 100644 index 8209b94606592..0000000000000 --- a/pkgs/development/python-modules/asyncio-mqtt/default.nix +++ /dev/null @@ -1,71 +0,0 @@ -{ - lib, - anyio, - buildPythonPackage, - fetchFromGitHub, - paho-mqtt, - pytestCheckHook, - pythonOlder, - setuptools, - setuptools-scm, - typing-extensions, - wheel, -}: - -buildPythonPackage rec { - pname = "asyncio-mqtt"; - version = "0.16.1"; - format = "pyproject"; - - disabled = pythonOlder "3.7"; - - src = fetchFromGitHub { - owner = "sbtinstruments"; - repo = pname; - rev = "refs/tags/v${version}"; - hash = "sha256-f3JqocjOEwNjo6Uv17ij6oEdrjb6Z2wTzdhdVhx46iM="; - }; - - nativeBuildInputs = [ - setuptools - setuptools-scm - wheel - ]; - - propagatedBuildInputs = [ paho-mqtt ] ++ lib.optionals (pythonOlder "3.10") [ typing-extensions ]; - - nativeCheckInputs = [ - anyio - pytestCheckHook - ]; - - pythonImportsCheck = [ "asyncio_mqtt" ]; - - disabledTests = [ - # Tests require network access - "test_client_filtered_messages" - "test_client_logger" - "test_client_max_concurrent_outgoing_calls" - "test_client_no_pending_calls_warnings_with_max_concurrent_outgoing_calls" - "test_client_pending_calls_threshold" - "test_client_tls_context" - "test_client_tls_params" - "test_client_unfiltered_messages" - "test_client_unsubscribe" - "test_client_username_password " - "test_client_websockets" - "test_client_will" - "test_multiple_messages_generators" - ]; - - # newer version are packaged as aiomqtt - passthru.skipBulkUpdate = true; - - meta = with lib; { - description = "Idomatic asyncio wrapper around paho-mqtt"; - homepage = "https://github.com/sbtinstruments/asyncio-mqtt"; - license = licenses.bsd3; - changelog = "https://github.com/sbtinstruments/asyncio-mqtt/blob/v${version}/CHANGELOG.md"; - maintainers = with maintainers; [ hexa ]; - }; -} diff --git a/pkgs/top-level/python-aliases.nix b/pkgs/top-level/python-aliases.nix index ea0931d50b0db..5bc297c3a223a 100644 --- a/pkgs/top-level/python-aliases.nix +++ b/pkgs/top-level/python-aliases.nix @@ -54,6 +54,7 @@ mapAliases ({ APScheduler = apscheduler; # added 2023-02-19 async_generator = async-generator; # added 2023-08-08 async_stagger = async-stagger; # added 2023-08-08 + asyncio-mqtt = throw "asyncio-mqtt has been replaced by aiomqtt, which is not API compatible."; # added 2024-07-07 asyncio-nats-client = nats-py; # added 2022-02-08 atsim_potentials = atsim-potentials; # added 2023-10-08 awkward0 = throw "awkward0 has been removed, use awkward instead"; # added 2022-12-13 diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index d15a274088992..39b8b28be828b 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -887,8 +887,6 @@ self: super: with self; { asyncio-dgram = callPackage ../development/python-modules/asyncio-dgram { }; - asyncio-mqtt = callPackage ../development/python-modules/asyncio-mqtt { }; - asyncio-rlock = callPackage ../development/python-modules/asyncio-rlock { }; asyncmy = callPackage ../development/python-modules/asyncmy { }; From c96f34fdfd872108d6f24c1b3e590dc9267bff52 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sun, 7 Jul 2024 16:47:48 +0200 Subject: [PATCH 4/4] ospd-openvas: relax dependencies --- pkgs/tools/security/ospd-openvas/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/security/ospd-openvas/default.nix b/pkgs/tools/security/ospd-openvas/default.nix index 5d7b517ec2869..a889f01689244 100644 --- a/pkgs/tools/security/ospd-openvas/default.nix +++ b/pkgs/tools/security/ospd-openvas/default.nix @@ -17,13 +17,14 @@ python3.pkgs.buildPythonApplication rec { }; pythonRelaxDeps = [ + "defusedxml" "packaging" + "psutil" "python-gnupg" ]; build-system = with python3.pkgs; [ poetry-core ]; - propagatedBuildInputs = with python3.pkgs; [ defusedxml deprecated