mirror of
https://github.com/VLSIDA/OpenRAM.git
synced 2026-08-22 06:07:31 +02:00
use python venv with nix
This commit is contained in:
@@ -19,6 +19,7 @@ compiler/tests/results/
|
||||
open_pdks/
|
||||
dist/
|
||||
openram.egg-info/
|
||||
.venv/
|
||||
sky130A
|
||||
sky130B
|
||||
gf180mcuA
|
||||
|
||||
@@ -247,5 +247,5 @@ build_library:
|
||||
|
||||
# Build and install the openram library
|
||||
library: build_library
|
||||
@python3 -m pip install --force dist/openram*.whl
|
||||
@python3 -m pip install --force-reinstall dist/openram*.whl
|
||||
.PHONY: library
|
||||
|
||||
@@ -38,11 +38,24 @@
|
||||
pkgs.git
|
||||
pkgs.gnumake
|
||||
pkgs.curl
|
||||
|
||||
# Python + pip (user installs, venvs; prefer Nix where possible)
|
||||
pkgs.python3
|
||||
pkgs.python3Packages.pip
|
||||
];
|
||||
|
||||
shellHook = ''
|
||||
export OPENRAM_USE_CONDA=0
|
||||
echo "OpenRAM: using tools from Nix devShell"
|
||||
# PEP 668: Nix `python3` is externally managed. Put a repo-local venv first on PATH
|
||||
# so `make library` uses it. Use $PWD (writable checkout), not `toString self` (nix store).
|
||||
OPENRAM_VENV="''${OPENRAM_HOME}/.venv"
|
||||
if [ ! -x "$OPENRAM_VENV/bin/python3" ]; then
|
||||
echo "OpenRAM: creating venv at $OPENRAM_VENV"
|
||||
${pkgs.python3}/bin/python3 -m venv "$OPENRAM_VENV"
|
||||
fi
|
||||
export VIRTUAL_ENV="$OPENRAM_VENV"
|
||||
export PATH="$OPENRAM_VENV/bin:$PATH"
|
||||
echo "OpenRAM: Nix devShell (venv on PATH: $OPENRAM_VENV)"
|
||||
'';
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user