1{ stdenv, fetchPypi, fetchpatch
2, buildPythonApplication, python, pythonOlder
3, mock, nose, pathpy, pyhamcrest, pytest_4
4, glibcLocales, parse, parse-type, six
5, traceback2, isPy38
6}:
7
8buildPythonApplication rec {
9 pname = "behave";
10 version = "1.2.6";
11
12 src = fetchPypi {
13 inherit pname version;
14 sha256 = "11hsz365qglvpp1m1w16239c3kiw15lw7adha49lqaakm8kj6rmr";
15 };
16
17 patches = [
18 # Fix tests on Python 2.7
19 (fetchpatch {
20 url = https://github.com/behave/behave/commit/0a9430a94881cd18437deb03d2ae23afea0f009c.patch;
21 sha256 = "1nrh9ii6ik6gw2kjh8a6jk4mg5yqw3jfjfllbyxardclsab62ydy";
22 })
23 ];
24
25 checkInputs = [ mock nose pathpy pyhamcrest pytest_4 ];
26 buildInputs = [ glibcLocales ];
27 propagatedBuildInputs = [ parse parse-type six ] ++ stdenv.lib.optional (pythonOlder "3.0") traceback2;
28
29 postPatch = ''
30 patchShebangs bin
31 '';
32
33 doCheck = true;
34
35 checkPhase = ''
36 export LANG="en_US.UTF-8"
37 export LC_ALL="en_US.UTF-8"
38
39 pytest test tests
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 stdenv.lib; {
47 homepage = https://github.com/behave/behave;
48 description = "behaviour-driven development, Python style";
49 license = licenses.bsd2;
50 maintainers = with maintainers; [ alunduil ];
51 broken = isPy38;
52 };
53}