nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 aiohttp,
4 asynctest,
5 buildPythonPackage,
6 fetchFromGitHub,
7 pytest-asyncio,
8 pytestCheckHook,
9 pythonOlder,
10}:
11
12buildPythonPackage rec {
13 pname = "pyversasense";
14 version = "0.0.6";
15 format = "setuptools";
16
17 src = fetchFromGitHub {
18 owner = "imstevenxyz";
19 repo = "pyversasense";
20 rev = "v${version}";
21 sha256 = "vTaDEwImWDMInwti0Jj+j+RFEtXOOKtiH5wOMD6ZmJk=";
22 };
23
24 propagatedBuildInputs = [ aiohttp ];
25
26 doCheck = pythonOlder "3.11"; # asynctest unsupported on python3.11
27
28 nativeCheckInputs = [
29 asynctest
30 pytest-asyncio
31 pytestCheckHook
32 ];
33
34 enabledTestPaths = [ "tests/test.py" ];
35
36 disabledTests = [
37 # Tests are not properly mocking network requests
38 "test_device_mac"
39 "test_peripheral_id"
40 "test_peripheral_measurements"
41 "test_samples"
42 ];
43
44 pythonImportsCheck = [ "pyversasense" ];
45
46 meta = {
47 description = "Python library to communicate with the VersaSense API";
48 homepage = "https://github.com/imstevenxyz/pyversasense";
49 license = lib.licenses.asl20;
50 maintainers = with lib.maintainers; [ fab ];
51 };
52}