Problem Description
poetry-core currently prepends its _vendor directory (__vendor_site__) to sys.path here. This causes poetry plugins to pick up whatever dependency version poetry has vendored, which may not be compatible with what the plugin requires / states in its dependencies.
For example, here's what we get after trying to update our poetry plugin to pydantic 2.0, which imports TypeAliasType from typing_extensions. Poetry's 1.6.1 vendored copy does not include TypeAliasType, so every poetry command crashes immediately:
$ poetry help
cannot import name 'TypeAliasType' from 'typing_extensions' (/home/user/venv/lib/python3.11/site-packages/poetry/core/_vendor/typing_extensions.py)
This could be fixed by vendoring similar to how pip does it, i.e. without modifying sys.path but by explictly importing from poetry.core._vendor.
Problem Description
poetry-core currently prepends its
_vendordirectory (__vendor_site__) tosys.pathhere. This causes poetry plugins to pick up whatever dependency version poetry has vendored, which may not be compatible with what the plugin requires / states in its dependencies.For example, here's what we get after trying to update our poetry plugin to pydantic 2.0, which imports
TypeAliasTypefromtyping_extensions. Poetry's 1.6.1 vendored copy does not includeTypeAliasType, so every poetry command crashes immediately:This could be fixed by vendoring similar to how pip does it, i.e. without modifying
sys.pathbut by explictly importing frompoetry.core._vendor.