mirror of
https://github.com/vale981/poetry2nix
synced 2025-03-04 08:41:42 -05:00
23 lines
705 B
Bash
23 lines
705 B
Bash
remove-@kind@-dependencies-hook() {
|
|
# Tell poetry not to resolve special dependencies. Any version is fine!
|
|
|
|
if ! test -f pyproject.toml; then
|
|
return
|
|
fi
|
|
|
|
echo "Removing @kind@ dependencies"
|
|
|
|
# NOTE: We have to reset PYTHONPATH to avoid having propagatedBuildInputs
|
|
# from the currently building derivation leaking into our unrelated Python
|
|
# environment.
|
|
PYTHONPATH=@pythonPath@ \
|
|
@pythonInterpreter@ \
|
|
@pyprojectPatchScript@ \
|
|
--fields-to-remove @fields@ < pyproject.toml > pyproject.formatted.toml
|
|
|
|
mv pyproject.formatted.toml pyproject.toml
|
|
|
|
echo "Finished removing @kind@ dependencies"
|
|
}
|
|
|
|
postPatchHooks+=(remove-@kind@-dependencies-hook)
|