@@ -1,12 +1,15 @@
11{ buildPythonPackage
2−, coveralls
32, fetchFromGitHub
4−, flake8
3+, fetchpatch
54, graphviz
5+, ifaddr
6+, isPy27
67, lib
78, mock
9+, nix-update-script
810, pytestCheckHook
911, requests
12+, requests-mock
1013, sphinx
1114, sphinx_rtd_theme
1215, toml
@@ -15,7 +18,8 @@
1518
1619buildPythonPackage rec {
1720 pname = "soco";
18− version = "0.20";
21+ version = "0.21.2";
22+ disabled = isPy27;
1923
2024 # N.B. We fetch from GitHub because the PyPI tarball doesn't contain the
2125 # required files to run the tests.
@@ -23,34 +27,46 @@ buildPythonPackage rec {
2327 owner = "SoCo";
2428 repo = "SoCo";
2529 rev = "v${version}";
26− sha256 = "0p87aw7wxgdjz0m0nqqcfvbn24hlbq1hh1zxdq2c0k2jcbmaj8zc";
30+ sha256 = "sha256-CCgkzUkt9YqTJt9tPBLmYXW6ZuRoMDd7xahYmNXgfM0=";
2731 };
2832
33+ patches = [(fetchpatch {
34+ url = "https://patch-diff.githubusercontent.com/raw/SoCo/SoCo/pull/811.patch";
35+ sha256 = "sha256-GBd74c8zc25ROO411SZ9TTa+bi8yXJaaOQqY9FM1qj4=";
36+ })];
37+
2938 # N.B. These exist because:
3039 # 1. Upstream's pinning isn't well maintained, leaving dependency versions no
3140 # longer in nixpkgs.
3241 # 2. There is no benefit for us to be running linting and coverage tests.
3342 postPatch = ''
3443 sed -i "/black/d" ./requirements-dev.txt
44+ sed -i "/coveralls/d" ./requirements-dev.txt
45+ sed -i "/flake8/d" ./requirements-dev.txt
3546 sed -i "/pylint/d" ./requirements-dev.txt
3647 sed -i "/pytest-cov/d" ./requirements-dev.txt
3748 '';
3849
3950 propagatedBuildInputs = [
51+ ifaddr
4052 requests
4153 toml
4254 xmltodict
4355 ];
56+
4457 checkInputs = [
4558 pytestCheckHook
46− coveralls
47− flake8
4859 graphviz
4960 mock
61+ requests-mock
5062 sphinx
5163 sphinx_rtd_theme
5264 ];
5365
66+ passthru.updateScript = nix-update-script {
67+ attrPath = "python3Packages.${pname}";
68+ };
69+
5470 meta = with lib; {
5571 homepage = "http://python-soco.com/";
5672 description = "A CLI and library to control Sonos speakers";