Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions python-setup/auto_install_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,16 @@ def _check_output(command, extra_env={}):

def install_packages_with_poetry():

# To handle poetry 1.2, which started to use keyring interaction MUCH more, we need
# add a workaround. See
# https://github.com/python-poetry/poetry/issues/2692#issuecomment-1235683370
extra_poetry_env = {"PYTHON_KEYRING_BACKEND": "keyring.backends.null.Keyring"}
extra_poetry_env = {
# To handle poetry 1.2, which started to use keyring interaction MUCH more, we need
# add a workaround. See
# https://github.com/python-poetry/poetry/issues/2692#issuecomment-1235683370
"PYTHON_KEYRING_BACKEND": "keyring.backends.null.Keyring",
# Projects that specify `in-project = true` in their poetry.toml would get the
# venv created inside the repo directory, which would cause CodeQL to consider
# it as user-written code. We don't want this to happen.
"POETRY_VIRTUALENVS_IN_PROJECT": "False",
}

command = [sys.executable, '-m', 'poetry']
if sys.platform.startswith('win32'):
Expand Down
2 changes: 2 additions & 0 deletions python-setup/tests/poetry/requests-3/poetry.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[virtualenvs]
in-project = true