summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/awsiotsdk/default.nix
blob: 9176ed7b2eec8cfc3ca40d7b6bd2a3e9718bac1d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
{
  lib,
  awscrt,
  boto3,
  buildPythonPackage,
  fetchFromGitHub,
  pytestCheckHook,
  setuptools,
}:

buildPythonPackage rec {
  pname = "awsiotsdk";
  version = "1.27.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "aws";
    repo = "aws-iot-device-sdk-python-v2";
    tag = "v${version}";
    hash = "sha256-CafecTMRNIKQ2FB13SLJwtYwysNMG5DYl2xfHnejApU=";
  };

  postPatch = ''
    substituteInPlace awsiot/__init__.py \
      --replace-fail  "__version__ = '1.0.0-dev'" "__version__ = '${version}'"
  '';

  pythonRelaxDeps = [ "awscrt" ];

  build-system = [ setuptools ];

  dependencies = [ awscrt ];

  nativeCheckInputs = [
    boto3
    pytestCheckHook
  ];

  disabledTestPaths = [
    # Those tests require a custom loader
    "servicetests/"
  ];

  pythonImportsCheck = [ "awsiot" ];

  meta = {
    description = "Next generation AWS IoT Client SDK for Python using the AWS Common Runtime";
    homepage = "https://github.com/aws/aws-iot-device-sdk-python-v2";
    changelog = "https://github.com/aws/aws-iot-device-sdk-python-v2/releases/tag/${src.tag}";
    license = lib.licenses.asl20;
    maintainers = with lib.maintainers; [ fab ];
  };
}