1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchPypi,
6 fontconfig,
7 graphviz,
8 mock,
9 pycodestyle,
10 pygraphviz,
11 pytestCheckHook,
12 pythonAtLeast,
13 setuptools,
14 six,
15}:
16
17buildPythonPackage rec {
18 pname = "transitions";
19 version = "0.9.1";
20 pyproject = true;
21
22 src = fetchPypi {
23 inherit pname version;
24 hash = "sha256-NULDcQjpPirl8hUgjsVzLJSncpN4VKECzXNFuWf+5hs=";
25 };
26
27 build-system = [ setuptools ];
28
29 dependencies = [
30 six
31 pygraphviz # optional
32 ];
33
34 nativeCheckInputs = [
35 pytestCheckHook
36 mock
37 graphviz
38 pycodestyle
39 ];
40
41 preCheck = ''
42 export FONTCONFIG_FILE=${fontconfig.out}/etc/fonts/fonts.conf
43 export HOME=$TMPDIR
44 '';
45
46 disabledTests =
47 [
48 "test_diagram"
49 "test_ordered_with_graph"
50 ]
51 ++ lib.optionals stdenv.isDarwin [
52 # Upstream issue https://github.com/pygraphviz/pygraphviz/issues/441
53 "test_binary_stream"
54 ];
55
56 pythonImportsCheck = [ "transitions" ];
57
58 meta = with lib; {
59 homepage = "https://github.com/pytransitions/transitions";
60 description = "Lightweight, object-oriented finite state machine implementation in Python";
61 changelog = "https://github.com/pytransitions/transitions/releases/tag/${version}";
62 license = licenses.mit;
63 maintainers = with maintainers; [ dotlambda ];
64 };
65}