nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchFromGitHub,
6 hatchling,
7 pytestCheckHook,
8}:
9
10let
11 testing = fetchFromGitHub {
12 owner = "eclipse";
13 repo = "paho.mqtt.testing";
14 rev = "a4dc694010217b291ee78ee13a6d1db812f9babd";
15 hash = "sha256-SQoNdkWMjnasPjpXQF2yV97MUra8gb27pc3rNoA8Rjw=";
16 };
17in
18buildPythonPackage rec {
19 pname = "paho-mqtt";
20 version = "2.1.0";
21 pyproject = true;
22
23 src = fetchFromGitHub {
24 owner = "eclipse";
25 repo = "paho.mqtt.python";
26 rev = "v${version}";
27 hash = "sha256-VMq+WTW+njK34QUUTE6fR2j2OmHxVzR0wrC92zYb1rY=";
28 };
29
30 build-system = [
31 hatchling
32 ];
33
34 nativeCheckInputs = [
35 pytestCheckHook
36 ];
37
38 __darwinAllowLocalNetworking = true;
39
40 pythonImportsCheck = [ "paho.mqtt" ];
41
42 preCheck = ''
43 ln -s ${testing} paho.mqtt.testing
44
45 # paho.mqtt not in top-level dir to get caught by this
46 export PYTHONPATH=".:$PYTHONPATH"
47 '';
48
49 meta = {
50 changelog = "https://github.com/eclipse/paho.mqtt.python/blob/${src.rev}/ChangeLog.txt";
51 description = "MQTT version 5.0/3.1.1 client class";
52 homepage = "https://eclipse.org/paho";
53 license = lib.licenses.epl20;
54 maintainers = with lib.maintainers; [
55 mog
56 dotlambda
57 ];
58 };
59}