2020-12-09 00:28:41 +00:00
|
|
|
{ buildPythonPackage
|
|
|
|
, coveralls
|
|
|
|
, fetchFromGitHub
|
|
|
|
, flake8
|
|
|
|
, graphviz
|
|
|
|
, lib
|
|
|
|
, mock
|
|
|
|
, pytestCheckHook
|
|
|
|
, requests
|
|
|
|
, sphinx
|
2018-06-29 20:04:42 +01:00
|
|
|
, sphinx_rtd_theme
|
2020-12-09 00:28:41 +00:00
|
|
|
, toml
|
|
|
|
, xmltodict
|
2018-06-29 20:04:42 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "soco";
|
2020-11-29 14:04:42 +00:00
|
|
|
version = "0.20";
|
2018-06-29 20:04:42 +01:00
|
|
|
|
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";
|
2018-06-29 20:04:42 +01:00
|
|
|
};
|
|
|
|
|
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
|
|
|
|
];
|
2018-06-29 20:04:42 +01:00
|
|
|
checkInputs = [
|
2020-12-09 00:28:41 +00:00
|
|
|
pytestCheckHook
|
|
|
|
coveralls
|
|
|
|
flake8
|
|
|
|
graphviz
|
|
|
|
mock
|
|
|
|
sphinx
|
2018-06-29 20:04:42 +01:00
|
|
|
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/";
|
2018-06-29 20:04:42 +01:00
|
|
|
description = "A CLI and library to control Sonos speakers";
|
2020-12-09 00:28:41 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ lovesegfault ];
|
2018-06-29 20:04:42 +01:00
|
|
|
};
|
|
|
|
}
|