nixpkgs/pkgs/development/python-modules/soco/default.nix

61 lines
1.3 KiB
Nix
Raw Normal View History

2020-12-09 00:28:41 +00:00
{ buildPythonPackage
, coveralls
, fetchFromGitHub
, flake8
, graphviz
, lib
, mock
, pytestCheckHook
, requests
, sphinx
, sphinx_rtd_theme
2020-12-09 00:28:41 +00:00
, toml
, xmltodict
}:
buildPythonPackage rec {
pname = "soco";
2020-11-29 14:04:42 +00:00
version = "0.20";
2020-12-09 00:28:41 +00:00
# N.B. We fetch from GitHub because the PyPI tarball doesn't contain the
# required files to run the tests.
src = fetchFromGitHub {
owner = "SoCo";
repo = "SoCo";
rev = "v${version}";
sha256 = "0p87aw7wxgdjz0m0nqqcfvbn24hlbq1hh1zxdq2c0k2jcbmaj8zc";
};
2020-12-09 00:28:41 +00:00
# N.B. These exist because:
# 1. Upstream's pinning isn't well maintained, leaving dependency versions no
# longer in nixpkgs.
# 2. There is no benefit for us to be running linting and coverage tests.
postPatch = ''
sed -i "/black/d" ./requirements-dev.txt
sed -i "/pylint/d" ./requirements-dev.txt
sed -i "/pytest-cov/d" ./requirements-dev.txt
'';
propagatedBuildInputs = [
requests
toml
xmltodict
];
checkInputs = [
2020-12-09 00:28:41 +00:00
pytestCheckHook
coveralls
flake8
graphviz
mock
sphinx
sphinx_rtd_theme
];
2020-12-09 00:28:41 +00:00
meta = with lib; {
2020-04-07 08:27:14 +01:00
homepage = "http://python-soco.com/";
description = "A CLI and library to control Sonos speakers";
2020-12-09 00:28:41 +00:00
license = licenses.mit;
maintainers = with maintainers; [ lovesegfault ];
};
}