2020-12-25 13:55:36 +00:00
|
|
|
{ buildPythonPackage
|
|
|
|
, coveralls
|
|
|
|
, fetchFromGitHub
|
|
|
|
, flake8
|
|
|
|
, graphviz
|
|
|
|
, lib
|
|
|
|
, mock
|
|
|
|
, pytestCheckHook
|
|
|
|
, requests
|
|
|
|
, sphinx
|
2020-04-24 23:36:52 +00:00
|
|
|
, sphinx_rtd_theme
|
2020-12-25 13:55:36 +00:00
|
|
|
, toml
|
|
|
|
, xmltodict
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "soco";
|
2020-12-07 07:45:13 +00:00
|
|
|
version = "0.20";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-12-25 13:55:36 +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-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2020-12-25 13:55:36 +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
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
checkInputs = [
|
2020-12-25 13:55:36 +00:00
|
|
|
pytestCheckHook
|
|
|
|
coveralls
|
|
|
|
flake8
|
|
|
|
graphviz
|
|
|
|
mock
|
|
|
|
sphinx
|
2020-04-24 23:36:52 +00:00
|
|
|
sphinx_rtd_theme
|
|
|
|
];
|
|
|
|
|
2020-12-25 13:55:36 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "http://python-soco.com/";
|
|
|
|
description = "A CLI and library to control Sonos speakers";
|
2020-12-25 13:55:36 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ lovesegfault ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|