templates/python: improve shell.nix
This commit is contained in:
parent
178df2eccb
commit
cf583e2d44
@ -42,7 +42,7 @@
|
|||||||
passthru.devDependencies = devDependencies;
|
passthru.devDependencies = devDependencies;
|
||||||
};
|
};
|
||||||
|
|
||||||
checkPython = python3.withPackages (ps: devDependencies);
|
checkPython = python3.withPackages (ps: devDependencies ++ dependencies);
|
||||||
|
|
||||||
check = runCommand "${name}-check" {} ''
|
check = runCommand "${name}-check" {} ''
|
||||||
cp -r ${src} ./src
|
cp -r ${src} ./src
|
||||||
|
@ -27,19 +27,17 @@
|
|||||||
shellHook = ''
|
shellHook = ''
|
||||||
tmp_path=$(realpath ./.pythonenv)
|
tmp_path=$(realpath ./.pythonenv)
|
||||||
repo_root=$(realpath .)
|
repo_root=$(realpath .)
|
||||||
if ! cmp -s pyproject.toml $tmp_path/pyproject.toml; then
|
rm -rf $tmp_path
|
||||||
rm -rf $tmp_path
|
mkdir -p "$tmp_path/${pythonWithDeps.sitePackages}"
|
||||||
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 PATH="$tmp_path/bin:${checkScript}/bin:$PATH"
|
||||||
export PYTHONPATH="$repo_root:$tmp_path/${pythonWithDeps.sitePackages}"
|
export PYTHONPATH="$repo_root:$tmp_path/${pythonWithDeps.sitePackages}"
|
||||||
'';
|
'';
|
||||||
|
Loading…
Reference in New Issue
Block a user