1# Start this shell with:
2# nix-shell path/to/root/of/nixpkgs -A flattenReferencesGraph.dev-shell
3{
4 mkShell,
5 callPackage,
6 python3Packages,
7}:
8let
9 helpers = callPackage (import ./helpers.nix) { };
10in
11mkShell {
12 inputsFrom = [ (callPackage (import ./package.nix) { }) ];
13 buildInputs = [
14 helpers.format
15 helpers.lint
16 helpers.unittest
17 # This is needed to plot graphs when DEBUG_PLOT is set to True.
18 python3Packages.pycairo
19 # This can be used on linux to display the graphs.
20 # On other platforms the image viewer needs to be set with
21 # DEBUG_PLOT_IMAGE_VIEWER env var.
22 # pkgs.gwenview
23 ];
24 shellHook = ''
25 echo '
26 **********************************************************************
27 **********************************************************************
28
29 Commands useful for development (should be executed from scr dir):
30
31
32 format
33 * formats all files in place using autopep8
34
35 lint
36 * lints all files using flake8
37
38 unittest
39 * runs all unit tests
40
41 following env vars can be set to enable extra output in tests:
42 - DEBUG=True - enable debug logging
43 - DEBUG_PLOT=True - plot graphs processed by split_paths.py and
44 subcomponent.py
45 - DEBUG_PLOT_IMAGE_VIEWER=$PATH_OF_IMAGE_VIEWER_APP - app used to
46 display plots (default: gwenview)
47 - DEBUG_PLOT_SAVE_BASE_NAME=$SOME_NAME - if set, plots will be saved
48 to files instead of displayed with image viewer
49
50 **********************************************************************
51 **********************************************************************
52 '
53 '';
54}