Files
nixpkgs/pkgs/development/python-modules/pyairvisual/default.nix
T

77 lines
1.4 KiB
Nix

{ lib
, aiohttp
, aresponses
, buildPythonPackage
, certifi
, fetchFromGitHub
, numpy
, poetry-core
, pygments
, pysmb
, pytest-aiohttp
, pytest-asyncio
, pytestCheckHook
, pythonOlder
}:
buildPythonPackage rec {
pname = "pyairvisual";
version = "2023.11.0";
pyproject = true;
disabled = pythonOlder "3.9";
src = fetchFromGitHub {
owner = "bachya";
repo = "pyairvisual";
rev = "refs/tags/${version}";
hash = "sha256-69lLw+ZYQ4hfD6xsfq1DVTWCnbp7e+qexuW3osDUejg=";
};
postPatch = ''
substituteInPlace pyproject.toml --replace \
'certifi = ">=2023.07.22"' \
'certifi = "*"'
'';
nativeBuildInputs = [
poetry-core
];
propagatedBuildInputs = [
aiohttp
certifi
numpy
pygments
pysmb
];
# this lets tests bind to localhost in sandbox mode on macOS
__darwinAllowLocalNetworking = true;
nativeCheckInputs = [
aresponses
pytest-aiohttp
pytest-asyncio
pytestCheckHook
pytestCheckHook
];
disabledTestPaths = [
# Ignore the examples directory as the files are prefixed with test_.
"examples/"
];
pythonImportsCheck = [
"pyairvisual"
];
meta = with lib; {
description = "Python library for interacting with AirVisual";
homepage = "https://github.com/bachya/pyairvisual";
changelog = "https://github.com/bachya/pyairvisual/releases/tag/${version}";
license = with licenses; [ mit ];
maintainers = with maintainers; [ fab ];
};
}