cardano-node-tests icon indicating copy to clipboard operation
cardano-node-tests copied to clipboard

Use Nix instead of venv?

Open Mr-Andersen opened this issue 3 years ago • 3 comments

Currently the repo uses both Nix and venv to create dev environments. It's possible to dispose of venv and only use Nix. It would make development and test runs cleaner and easier to perform. I can implement this myself.

Mr-Andersen avatar Apr 29 '22 13:04 Mr-Andersen

Hey! You can run nix-shell in root of the repo and you'll have everything that is needed for running the tests (we run our nightly jobs this way).

For development we need to use some packages in "editable" mode (pip install -e ...), not sure if that would work with nix? Namely cardano-clusterlib where we often need to make changes and test it together with cardano-node-tests.

mkoura avatar Apr 29 '22 13:04 mkoura

@mkoura oh, nice, you should mention that in readme :) However, when I call make lint from under nix-shell, it reports:

$ make lint
pre-commit run -a
make: pre-commit: No such file or directory
make: *** [Makefile:16: lint] Error 127

Are Nix and venv not in parity?

Mr-Andersen avatar Apr 29 '22 14:04 Mr-Andersen

This fixes it:

diff --git a/nix/default.nix b/nix/default.nix
index c342e8cd..ed087666 100644
--- a/nix/default.nix
+++ b/nix/default.nix
@@ -53,6 +53,7 @@ let
           requests
           psycopg2
           pandas
+          pre-commit
         ])) ];
       });
     });

Mr-Andersen avatar Apr 29 '22 14:04 Mr-Andersen