Remove the sys path hacks (again) to fix edge cases with keyring #5732
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The issue
Fixes #5719
Fixes #4706
The fix
When we added back the hack to the sys.path it broke the google keyring support, I verified this -- because the appropriate requests package module cannot be found (strangely). My goal has bene to eliminate these path patchces for a while and there were a couple reasons I had to add them back recent which I think have since been resolved:
1.) pydantic was getting an import error on typing_extensions, but the latest vendor'd pydantic seems to have cleaner imports which got re-written to use the right vendor path.
2.) pipdeptree prior version was getting an error on
pipenv graph
but it seems like the new version ofpipdeptrees
may be immune.I verified that removing this path allows the google keyring stuff to work again.
It still requires that keyring and keyrings.google-artifactregistry-auth be either installed in virtualenv or the virtualenv has access to the system-site-packages.
Additionally, this change allows the sync command to use the
--site-packages
flag as well, for which I know there is an issue request in our backlog for this. You shouldn't have to relock to create a virtualenv that uses that flag.The checklist
news/
directory to describe this fix with the extension.bugfix.rst
,.feature.rst
,.behavior.rst
,.doc.rst
..vendor.rst
. or.trivial.rst
(this will appear in the release changelog). Use semantic line breaks and name the file after the issue number or the PR #.