1{ stdenv, fetchFromGitHub
2, buildPythonApplication, python
3, mock, pathpy, pyhamcrest, pytest, pytest-html
4, glibcLocales
5, colorama, cucumber-tag-expressions, parse, parse-type, six
6}:
7
8buildPythonApplication rec {
9 pname = "behave";
10 version = "1.2.7.dev1";
11
12 src = fetchFromGitHub {
13 owner = "behave";
14 repo = pname;
15 rev = "v${version}";
16 sha256 = "1ssgixmqlg8sxsyalr83a1970njc2wg3zl8idsmxnsljwacv7qwv";
17 };
18
19 checkInputs = [ mock pathpy pyhamcrest pytest pytest-html ];
20 buildInputs = [ glibcLocales ];
21 propagatedBuildInputs = [ colorama cucumber-tag-expressions parse parse-type six ];
22
23 postPatch = ''
24 patchShebangs bin
25 '';
26
27 doCheck = true;
28
29 checkPhase = ''
30 export LANG="en_US.UTF-8"
31 export LC_ALL="en_US.UTF-8"
32
33 pytest tests
34
35 ${python.interpreter} bin/behave -f progress3 --stop --tags='~@xfail' features/
36 ${python.interpreter} bin/behave -f progress3 --stop --tags='~@xfail' tools/test-features/
37 ${python.interpreter} bin/behave -f progress3 --stop --tags='~@xfail' issue.features/
38 '';
39
40 meta = with stdenv.lib; {
41 homepage = "https://github.com/behave/behave";
42 description = "behaviour-driven development, Python style";
43 license = licenses.bsd2;
44 maintainers = with maintainers; [ alunduil maxxk ];
45 };
46}