about summary refs log tree commit diff
path: root/pkgs/applications/networking/flexget/default.nix
blob: 814f6bb5548ec01c2f1875e7e61e63e45d2596f9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
{ lib
, fetchFromGitHub
, python
, transmission
, deluge
, config
}:

with python.pkgs;

buildPythonApplication rec {
  version = "2.10.40";
  name = "FlexGet-${version}";

  src = fetchFromGitHub {
    owner = "Flexget";
    repo = "Flexget";
    rev = version;
    sha256 = "0hh21yv1lvdfi198snwjabfsdh04fnpjszpgg28wvg5pd1qq8lqv";
  };

  doCheck = true;
  # test_regexp requires that HOME exist, test_filesystem requires a
  # unicode-capable filesystem (and setting LC_ALL doesn't work).
  # setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
  postPatch = ''
    sed -i '/def test_non_ascii/i\    import pytest\
        @pytest.mark.skip' flexget/tests/test_filesystem.py

    substituteInPlace requirements.txt --replace "guessit<=2.0.4" "guessit"
  '';

  # Disable 3 failing tests caused by guessit upgrade
  # https://github.com/Flexget/Flexget/issues/1804
  checkPhase = ''
    export HOME=.
    py.test --disable-pytest-warnings -k "not test_date_options and not test_ep_as_quality and not testFromGroup"
  '';

  buildInputs = [ pytest mock vcrpy pytest-catchlog boto3 ];
  propagatedBuildInputs = [
    feedparser sqlalchemy pyyaml
    beautifulsoup4 html5lib PyRSS2Gen pynzb
    rpyc jinja2 requests dateutil jsonschema
    pathpy guessit APScheduler
    terminaltables colorclass
    cherrypy flask flask-restful flask-restplus_0_8
    flask-compress flask_login flask-cors
    pyparsing safe future zxcvbn-python ]
  ++ lib.optional (pythonOlder "3.4") pathlib
  # enable deluge and transmission plugin support, if they're installed
  ++ lib.optional (config.deluge or false) deluge
  ++ lib.optional (transmission != null) transmissionrpc;

  meta = {
    homepage = https://flexget.com/;
    description = "Multipurpose automation tool for content like torrents";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ domenkozar tari ];
  };
}