1{ lib, stdenv, fetchFromGitHub
2, buildPythonPackage, python
3, pytestCheckHook, mock, path, pyhamcrest, pytest-html
4, glibcLocales
5, colorama, cucumber-tag-expressions, parse, parse-type, six
6}:
7
8buildPythonPackage rec {
9 pname = "behave";
10 version = "1.2.7.dev2";
11
12 src = fetchFromGitHub {
13 owner = "behave";
14 repo = pname;
15 rev = "v${version}";
16 hash = "sha256-B8PUN1Q4UAsDWrHjPZDlpaPjCKjI/pAogCSI+BQnaWs=";
17 };
18
19 checkInputs = [ pytestCheckHook mock path pyhamcrest pytest-html ];
20
21 # upstream tests are failing, so instead we only check if we can import it
22 doCheck = false;
23
24 pythonImportsCheck = [ "behave" ];
25
26 buildInputs = [ glibcLocales ];
27 propagatedBuildInputs = [ colorama cucumber-tag-expressions parse parse-type six ];
28
29 postPatch = ''
30 patchShebangs bin
31 '';
32
33 # timing-based test flaky on Darwin
34 # https://github.com/NixOS/nixpkgs/pull/97737#issuecomment-691489824
35 disabledTests = lib.optionals stdenv.isDarwin [ "test_step_decorator_async_run_until_complete" ];
36
37 postCheck = ''
38 export LANG="en_US.UTF-8"
39 export LC_ALL="en_US.UTF-8"
40
41 ${python.interpreter} bin/behave -f progress3 --stop --tags='~@xfail' features/
42 ${python.interpreter} bin/behave -f progress3 --stop --tags='~@xfail' tools/test-features/
43 ${python.interpreter} bin/behave -f progress3 --stop --tags='~@xfail' issue.features/
44 '';
45
46 meta = with lib; {
47 homepage = "https://github.com/behave/behave";
48 description = "behaviour-driven development, Python style";
49 license = licenses.bsd2;
50 maintainers = with maintainers; [ alunduil maxxk ];
51 };
52}