···66, editablePackageSources
77}:
88let
99- name = poetryLib.moduleName pyProject.tool.poetry.name;
99+ name = poetryLib.normalizePackageName pyProject.tool.poetry.name;
10101111 # Just enough standard PKG-INFO fields for an editable installation
1212 pkgInfoFields = {
···18181919 # "Vendor" dependencies (for build-system support)
2020 postPatch = ''
2121- echo "import sys" >> poetry/__init__.py
2121+ # Figure out the location of poetry.core
2222+ # As poetry.core is using the same root import name as the poetry package and the python module system wont look for the root
2323+ # in the separate second location we need to link poetry.core to poetry
2424+ POETRY_CORE=$(python -c 'import poetry.core; import os.path; print(os.path.dirname(poetry.core.__file__))')
2525+2626+ echo "import sys" >> src/poetry/__init__.py
2227 for path in $propagatedBuildInputs; do
2323- echo "sys.path.insert(0, \"$path\")" >> poetry/__init__.py
2828+ echo "sys.path.insert(0, \"$path\")" >> src/poetry/__init__.py
2429 done
2530 '';
26312732 postInstall = ''
2828- # Figure out the location of poetry.core
2929- # As poetry.core is using the same root import name as the poetry package and the python module system wont look for the root
3030- # in the separate second location we need to link poetry.core to poetry
3131- ln -s $(python -c 'import poetry.core; import os.path; print(os.path.dirname(poetry.core.__file__))') $out/${python.sitePackages}/poetry/core
3333+ ln -s $POETRY_CORE $out/${python.sitePackages}/poetry/core
32343335 mkdir -p "$out/share/bash-completion/completions"
3436 "$out/bin/poetry" completions bash > "$out/share/bash-completion/completions/poetry"