python3Packages.soco: fixup and adopt
This commit is contained in:
parent
f3103fe2d1
commit
13b73ddeb0
|
@ -1,29 +1,60 @@
|
||||||
{ lib, buildPythonPackage, fetchPypi, xmltodict, requests
|
{ buildPythonPackage
|
||||||
, toml
|
, coveralls
|
||||||
|
, fetchFromGitHub
|
||||||
# Test dependencies
|
, flake8
|
||||||
, pytest, pytestcov, coveralls, pylint, flake8, graphviz, mock, sphinx
|
, graphviz
|
||||||
|
, lib
|
||||||
|
, mock
|
||||||
|
, pytestCheckHook
|
||||||
|
, requests
|
||||||
|
, sphinx
|
||||||
, sphinx_rtd_theme
|
, sphinx_rtd_theme
|
||||||
|
, toml
|
||||||
|
, xmltodict
|
||||||
}:
|
}:
|
||||||
|
|
||||||
buildPythonPackage rec {
|
buildPythonPackage rec {
|
||||||
pname = "soco";
|
pname = "soco";
|
||||||
version = "0.20";
|
version = "0.20";
|
||||||
|
|
||||||
src = fetchPypi {
|
# N.B. We fetch from GitHub because the PyPI tarball doesn't contain the
|
||||||
inherit pname version;
|
# required files to run the tests.
|
||||||
sha256 = "929d4fae20b32efc08bb9985798c592aa7268162885541513eddbff0a757418f";
|
src = fetchFromGitHub {
|
||||||
|
owner = "SoCo";
|
||||||
|
repo = "SoCo";
|
||||||
|
rev = "v${version}";
|
||||||
|
sha256 = "0p87aw7wxgdjz0m0nqqcfvbn24hlbq1hh1zxdq2c0k2jcbmaj8zc";
|
||||||
};
|
};
|
||||||
|
|
||||||
propagatedBuildInputs = [ xmltodict requests toml ];
|
# 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 = [
|
checkInputs = [
|
||||||
pytest pytestcov coveralls pylint flake8 graphviz mock sphinx
|
pytestCheckHook
|
||||||
|
coveralls
|
||||||
|
flake8
|
||||||
|
graphviz
|
||||||
|
mock
|
||||||
|
sphinx
|
||||||
sphinx_rtd_theme
|
sphinx_rtd_theme
|
||||||
];
|
];
|
||||||
|
|
||||||
meta = {
|
meta = with lib; {
|
||||||
homepage = "http://python-soco.com/";
|
homepage = "http://python-soco.com/";
|
||||||
description = "A CLI and library to control Sonos speakers";
|
description = "A CLI and library to control Sonos speakers";
|
||||||
license = lib.licenses.mit;
|
license = licenses.mit;
|
||||||
|
maintainers = with maintainers; [ lovesegfault ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue