1{ stdenv, fetchFromGitHub
2, buildPythonApplication, python
3, pytestCheckHook, mock, pathpy, pyhamcrest, 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 = [ pytestCheckHook mock pathpy pyhamcrest pytest-html ];
20 buildInputs = [ glibcLocales ];
21 propagatedBuildInputs = [ colorama cucumber-tag-expressions parse parse-type six ];
22
23 postPatch = ''
24 patchShebangs bin
25 '';
26
27 # timing-based test flaky on Darwin
28 # https://github.com/NixOS/nixpkgs/pull/97737#issuecomment-691489824
29 disabledTests = stdenv.lib.optionals stdenv.isDarwin [ "test_step_decorator_async_run_until_complete" ];
30
31 postCheck = ''
32 export LANG="en_US.UTF-8"
33 export LC_ALL="en_US.UTF-8"
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}