Repository: All-Hands-AI/OpenHands
Pull request: doc: add Python keyring to Troubleshooting documentation
During build process some Python dependencies could get stuck in "pending" mode if `PYTHON_KEYRING_BACKEND` is not set in env (Poetry had a couple of issues related to this on their site, e.g. https://github.com/python-poetry/poetry/issues/5250).

Probably fixes: https://github.com/OpenDevin/OpenDevin/issues/919, https://github.com/OpenDevin/OpenDevin/issues/2285

Problem statement:
make run stuck on dependecies
<!-- You MUST fill out this template. We will close issues that don't include enough information to reproduce -->
installation stuck on dependencies. debian server.
<!-- a short description of the problem -->
**Logs:**
```
Package operations: 210 installs, 1 update, 0 removals

  - Installing certifi (2024.2.2): Pending...
  - Installing h11 (0.14.0): Pending...
  - Installing idna (3.6): Pending...
  - Installing sniffio (1.3.1): Pending...
  - Installing typing-extensions (4.11.0): Pending...
```

Hints from issue discussion:
I'm not sure why it'd do that. 😔 
Did you clone and run make build, or something else?
@nowheel do you still face the issue?

Same as here: https://github.com/OpenDevin/OpenDevin/issues/935

That was solved by updating poetry.
I'll close this issue, but if you still experience problems please open a new one.
still facing this problem after updating poetry to 1.8.2
@zingshowba try `poetry env remove python3.11` and after `make build`
> @zingshowba try `poetry env remove python3.11` and after `make build`

cool it works
@zingshowba Enjoy!!

Commit message: fix: set Python keyring for Poetry

Patch to review:
diff --git a/Makefile b/Makefile
index 29db6389de87..668792009ff9 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,11 @@
 SHELL=/bin/bash
 # Makefile for OpenDevin project
 
+# Check and set PYTHON_KEYRING_BACKEND if not already set
+ifndef PYTHON_KEYRING_BACKEND
+export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring
+endif
+
 # Variables
 DOCKER_IMAGE = ghcr.io/opendevin/sandbox
 BACKEND_PORT = 3000


Code review comments:
diff_hunk: @@ -1,6 +1,11 @@
 SHELL=/bin/bash
 # Makefile for OpenDevin project
 
+# Check and set PYTHON_KEYRING_BACKEND if not already set
+ifndef PYTHON_KEYRING_BACKEND
+export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring
+endif
path: Makefile
text: @user1:
If poetry doesn't want to include this, it seems we shouldn't do either. IMO a better place for this is the troubleshooting guide: https://opendevin.github.io/OpenDevin/modules/usage/troubleshooting

@author:
hmm... not sure that Poetry itself *should* include it anywhere, they just have to support it (for credentials).
Did you find a post of theirs about stating that, though?

However, I'll revert that and add it to the troubleshooter. 😀 

@user1:
They probably fixed it (after tons of complaints, thumbs up for workaround, and thumbs down for maintainers XD): https://github.com/python-poetry/poetry/issues/1917#issuecomment-1745782011

but someone still reported the same issue: https://github.com/python-poetry/poetry/issues/1917#issuecomment-1793322478

@user1:
So it's either they don't want to fix, or they don't have bandwidth to fix. I am generally opposed to applying hacks on our side if upstream doesn't fix it. Troubleshooting guide is the optimal place IMO, but others might have different opinions.

@author:
Well, they fixed to recognize 2 different settings of the keyring. Not sure what "fix" you expect?
Not sure they should just use some default value themselves.
Anyhow, already updating the documentation and hopefully then less users will run into this. ;)

@author:
Ready for review