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 <code@humanleg.org.uk>
Co-Authored-By: Martin Weinelt <hexa@darmstadt.ccc.de>
This commit is contained in:
Robert Schütz 2024-02-11 21:59:22 -08:00 committed by Martin Weinelt
parent 5290adb448
commit 1fd9c06c6e
No known key found for this signature in database
GPG Key ID: 87C1E9888F856759
3 changed files with 75 additions and 12 deletions

View File

@ -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
];
};
}

View File

@ -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

View File

@ -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 { };