Update python envrc
Switch back to using nix and add current src directory to PYTHONPATH
This commit is contained in:
parent
41be433044
commit
4f60cda7ba
25
templates
25
templates
|
@ -234,17 +234,20 @@ nix-mode
|
|||
|
||||
envrc-file-mode
|
||||
|
||||
(python "CC=\"$(nix build nixpkgs#stdenv.cc.cc.lib --print-out-paths --no-link)\"" n
|
||||
"ZLIB=\"$(nix build nixpkgs#zlib --print-out-paths --no-link)\"" n
|
||||
"PYTHON=\"$(nix build " (p "nixpkgs#python3Full") " --print-out-paths --no-link)/bin/python3\"" n
|
||||
"VENV_DIR=" (p ".venv") n
|
||||
"export LD_LIBRARY_PATH=\"$CC/lib\":\"$ZLIB/lib\"" n
|
||||
"if [ ! -f $VENV_DIR/bin/activate ]; then" n
|
||||
> "$PYTHON -m venv --clear $VENV_DIR" n
|
||||
"else" n
|
||||
> "$PYTHON -m venv --upgrade $VENV_DIR" n
|
||||
"fi" n
|
||||
"source $VENV_DIR/bin/activate")
|
||||
;; (python "CC=\"$(nix build nixpkgs#stdenv.cc.cc.lib --print-out-paths --no-link)\"" n
|
||||
;; "ZLIB=\"$(nix build nixpkgs#zlib --print-out-paths --no-link)\"" n
|
||||
;; "PYTHON=\"$(nix build " (p "nixpkgs#python3Full") " --print-out-paths --no-link)/bin/python3\"" n
|
||||
;; "VENV_DIR=" (p ".venv") n
|
||||
;; "export LD_LIBRARY_PATH=\"$CC/lib\":\"$ZLIB/lib\"" n
|
||||
;; "if [ ! -f $VENV_DIR/bin/activate ]; then" n
|
||||
;; > "$PYTHON -m venv --clear $VENV_DIR" n
|
||||
;; "else" n
|
||||
;; > "$PYTHON -m venv --upgrade $VENV_DIR" n
|
||||
;; "fi" n
|
||||
;; "source $VENV_DIR/bin/activate")
|
||||
(python "use nix" n
|
||||
"SRC=$(readlink -f " (p "./" ) ")" n
|
||||
"export PYTHONPATH=$SRC:" q "$PYTHONPATH")
|
||||
|
||||
;; Local Variables:
|
||||
;; mode: lisp-data
|
||||
|
|
Loading…
Reference in a new issue