summary refs log tree commit diff
path: root/pkgs/development/python-modules/behave/default.nix
blob: 7ad3489553c240f67f774f167f25fe522a8748ad (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
{ stdenv, fetchPypi, fetchpatch
, buildPythonApplication, python, pythonOlder
, mock, nose, pathpy, pyhamcrest, pytest
, glibcLocales, parse, parse-type, six
, traceback2
}:
buildPythonApplication rec {
  pname = "behave";
  version = "1.2.6";

  src = fetchPypi {
    inherit pname version;
    sha256 = "11hsz365qglvpp1m1w16239c3kiw15lw7adha49lqaakm8kj6rmr";
  };

  patches = [
    # Fix tests on Python 2.7
    (fetchpatch {
      url = https://github.com/behave/behave/commit/0a9430a94881cd18437deb03d2ae23afea0f009c.patch;
      sha256 = "1nrh9ii6ik6gw2kjh8a6jk4mg5yqw3jfjfllbyxardclsab62ydy";
    })
  ];

  checkInputs = [ mock nose pathpy pyhamcrest pytest ];
  buildInputs = [ glibcLocales ];
  propagatedBuildInputs = [ parse parse-type six ] ++ stdenv.lib.optional (pythonOlder "3.0") traceback2;

  postPatch = ''
    patchShebangs bin
  '';

  doCheck = true;

  checkPhase = ''
    export LANG="en_US.UTF-8"
    export LC_ALL="en_US.UTF-8"

    pytest test tests

    ${python.interpreter} bin/behave -f progress3 --stop --tags='~@xfail' features/
    ${python.interpreter} bin/behave -f progress3 --stop --tags='~@xfail' tools/test-features/
    ${python.interpreter} bin/behave -f progress3 --stop --tags='~@xfail' issue.features/
  '';

  meta = with stdenv.lib; {
    homepage = https://github.com/behave/behave;
    description = "behaviour-driven development, Python style";
    license = licenses.bsd2;
    maintainers = with maintainers; [ alunduil ];
  };
}