templates/python: improve shell.nix
This commit is contained in:
@@ -27,19 +27,17 @@
|
||||
shellHook = ''
|
||||
tmp_path=$(realpath ./.pythonenv)
|
||||
repo_root=$(realpath .)
|
||||
if ! cmp -s pyproject.toml $tmp_path/pyproject.toml; then
|
||||
rm -rf $tmp_path
|
||||
mkdir -p "$tmp_path/${pythonWithDeps.sitePackages}"
|
||||
rm -rf $tmp_path
|
||||
mkdir -p "$tmp_path/${pythonWithDeps.sitePackages}"
|
||||
|
||||
${pythonWithDeps.interpreter} -m pip install \
|
||||
--quiet \
|
||||
--disable-pip-version-check \
|
||||
--no-index \
|
||||
--no-build-isolation \
|
||||
--prefix "$tmp_path" \
|
||||
--editable $repo_root
|
||||
|
||||
${pythonWithDeps.interpreter} -m pip install \
|
||||
--quiet \
|
||||
--disable-pip-version-check \
|
||||
--no-index \
|
||||
--no-build-isolation \
|
||||
--prefix "$tmp_path" \
|
||||
--editable $repo_root && \
|
||||
cp -a pyproject.toml $tmp_path/pyproject.toml
|
||||
fi
|
||||
export PATH="$tmp_path/bin:${checkScript}/bin:$PATH"
|
||||
export PYTHONPATH="$repo_root:$tmp_path/${pythonWithDeps.sitePackages}"
|
||||
'';
|
||||
|
||||
Reference in New Issue
Block a user