about summary refs log tree commit diff
path: root/pkgs/development/python-modules/soco
diff options
context:
space:
mode:
authorBernardo Meurer <bernardo@meurer.org>2020-12-08 16:28:41 -0800
committerBernardo Meurer <bernardo@meurer.org>2020-12-09 11:11:28 -0800
commit13b73ddeb0e93bb5bca0ddb85b0b05a02e3c07a5 (patch)
treef8b0469456602f0826c6f9e23e34438904bb6c3d /pkgs/development/python-modules/soco
parentf3103fe2d1f087f36ba6d5b1787f3284a5f5781c (diff)
python3Packages.soco: fixup and adopt
Diffstat (limited to 'pkgs/development/python-modules/soco')
-rw-r--r--pkgs/development/python-modules/soco/default.nix55
1 files changed, 43 insertions, 12 deletions
diff --git a/pkgs/development/python-modules/soco/default.nix b/pkgs/development/python-modules/soco/default.nix
index e5fe491939fba..e203dc1c7aa54 100644
--- a/pkgs/development/python-modules/soco/default.nix
+++ b/pkgs/development/python-modules/soco/default.nix
@@ -1,29 +1,60 @@
-{ lib, buildPythonPackage, fetchPypi, xmltodict, requests
-, toml
-
-# Test dependencies
-, pytest, pytestcov, coveralls, pylint, flake8, graphviz, mock, sphinx
+{ buildPythonPackage
+, coveralls
+, fetchFromGitHub
+, flake8
+, graphviz
+, lib
+, mock
+, pytestCheckHook
+, requests
+, sphinx
 , sphinx_rtd_theme
+, toml
+, xmltodict
 }:
 
 buildPythonPackage rec {
   pname = "soco";
   version = "0.20";
 
-  src = fetchPypi {
-    inherit pname version;
-    sha256 = "929d4fae20b32efc08bb9985798c592aa7268162885541513eddbff0a757418f";
+  # 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";
   };
 
-  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 = [
-    pytest pytestcov coveralls pylint flake8 graphviz mock sphinx
+    pytestCheckHook
+    coveralls
+    flake8
+    graphviz
+    mock
+    sphinx
     sphinx_rtd_theme
   ];
 
-  meta = {
+  meta = with lib; {
     homepage = "http://python-soco.com/";
     description = "A CLI and library to control Sonos speakers";
-    license = lib.licenses.mit;
+    license = licenses.mit;
+    maintainers = with maintainers; [ lovesegfault ];
   };
 }