Unverified Commit 8660d7b6 authored by Martin Weinelt's avatar Martin Weinelt Committed by GitHub
Browse files

Merge pull request #325122 from risicle/ris-paho-mqtt-2.x

python312Packages.paho-mqtt_2: init at 2.1.0
parents aa3e6fad c96f34fd
Loading
Loading
Loading
Loading
+0 −62
Original line number Diff line number Diff line
{
  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";
  };
}
+0 −71
Original line number Diff line number Diff line
{
  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 ];
  };
}
+42 −0
Original line number Diff line number Diff line
{
  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
    ];
  };
}
+30 −11
Original line number Diff line number Diff line
@@ -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
+2 −1
Original line number Diff line number Diff line
@@ -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
Loading