OpenHands icon indicating copy to clipboard operation
OpenHands copied to clipboard

Chore Bump python version

Open tofarr opened this issue 1 year ago • 10 comments

We are already using 3.12 in our DockerFile anyway, so this upgrades the python version we use in our makefile

tofarr avatar Aug 22 '24 17:08 tofarr

@tofarr Hey, you may also have to cherry pick the latest commit from #3791 , my bad :(

tobitege avatar Sep 10 '24 11:09 tobitege

I'm investigating in my PR, why the Runtime Units tests work great, but now the integration tests fail 😔

tobitege avatar Sep 10 '24 12:09 tobitege

For the record, this seems to have been the last time we settled on 3.11: https://github.com/All-Hands-AI/OpenHands/pull/885. It may be worth to test chroma on Macs, as that was the main blocker for upgrading to 3.12 (once this PR is ready for review, we can test fresh installation and upgrade), and we can take a quick look at the linked issues to make sure those issues no longer exist.

FWIW I only use python 3.12 everywhere on openhands, and (1) I experienced the issue with chroma uninstallable via poetry long ago, worked around it manually with pip, and (2) I'm not seeing that issue or any issue related to 3.12 for months, it works just fine.

enyst avatar Sep 11 '24 12:09 enyst

@tofarr I've fixed the issues with the tests in my PR, you might want to cherry pick the latest commit(s) again.

At least I thought so... :(

tobitege avatar Sep 11 '24 13:09 tobitege

It's still looking for 3.11 🤔

openhands:INFO: docker.py:31 - Looking for: ['conda-forge::poetry', 'python=3.11']

enyst avatar Sep 17 '24 11:09 enyst

Also look into the Dockerfile.j2 template @tofarr I see like 40 files where 3.11 is mentioned (incl. docs)

tobitege avatar Sep 17 '24 11:09 tobitege

Party time, all CI finally passed! 🥳

enyst avatar Sep 24 '24 13:09 enyst

Are we ready to merge this now all CI passed? 🤔

xingyaoww avatar Sep 26 '24 19:09 xingyaoww

IMHO it would be good to have a few people test it, on WSL / Mac in particular, since those had issues when we last tried this.

It does work on my Mac as upgrade, over the existing stuff. I'll try what a clean install should look like.

Or we can merge and hope for the best, we can also revert if we must. In the first days after merge I assume we'll have reports from folks running main.

enyst avatar Sep 26 '24 19:09 enyst

I could test in WSL/Ubuntu on the weekend

tobitege avatar Sep 26 '24 19:09 tobitege

I regenerated this from scratch. It seems to work locally, but the sandbox build was slower due to a lot of dependencies needing different versions.

I also had to constrain protobuf as chromadb / opentelemetry did not work with the latest version.

tofarr avatar Oct 03 '24 14:10 tofarr

Once the macOS tests pass, ping me and I'll

  • force merge this
  • change the required checks from 3.11 to 3.12

rbren avatar Oct 03 '24 16:10 rbren

I went through poetry.lock again and didn't see anything suspicious.

Upgraded install works. New install worked (this had an issue on Mac with chroma-hnswlib a few months ago). Curiously though:

Collecting chroma-hnswlib
  Using cached chroma_hnswlib-0.7.6-cp312-cp312-macosx_11_0_arm64.whl.metadata (252 bytes)
Collecting numpy (from chroma-hnswlib)
  Downloading numpy-2.1.1-cp312-cp312-macosx_14_0_arm64.whl.metadata (60 kB)
Using cached chroma_hnswlib-0.7.6-cp312-cp312-macosx_11_0_arm64.whl (185 kB)
Downloading numpy-2.1.1-cp312-cp312-macosx_14_0_arm64.whl (5.1 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 5.1/5.1 MB 20.3 MB/s eta 0:00:00
Installing collected packages: numpy, chroma-hnswlib
Successfully installed chroma-hnswlib-0.7.6 numpy-2.1.1

Then:

 - Downgrading numpy (2.1.1 -> 1.26.4)

It looks like required by ... - llama-index-core <2.0.0 is why. I think it's fine. We have 1.x today and are overdue an update to numpy 2.x.x, but this is not specific to an upgrade to python 3.12.

I ran a make build / make run and played around. It looks ok.

enyst avatar Oct 03 '24 17:10 enyst