metadriverse / metadrive

MetaDrive: Open-source driving simulator
https://metadriverse.github.io/metadrive/
Apache License 2.0
671 stars 100 forks source link

support Python 3.12 / pin panda3d==1.10.14 / pin ray>=2.24.0 #720

Open BBBmau opened 1 month ago

BBBmau commented 1 month ago

What changes do you make in this PR?

Supports the use of Python 3.12 by pinning panda3d==1.10.14

I was able to run setup and as well as run python -m metadrive.examples.profile_metadrive successfully.

Checklist

BBBmau commented 1 month ago

any chance getting this merged? This would help a ton.

QuanyiLi commented 1 month ago

Hi @BBBmau

Thank you very much for contributing to the Python 3.12 support. We were too busy to reply to you in time. Sorry about that. We will finish the code review ASAP and get back to you soon.

Thanks.

BBBmau commented 1 month ago

removed unnecessary commits, workflow can be ran once more.

QuanyiLi commented 1 month ago

Hi @BBBmau,

Could you adjust the github CI workflow to allow running all tests with both python3.12 and python3.9? A guide is at: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

But before this, please merge the latest main branch into this PR as I just fixed all CI failures and all tests now work well for python3.9. It is expected that they still work for python3.12.

Thanks

BBBmau commented 1 month ago

@QuanyiLi I've applied the updates to CI to include 3.12 testing with the matrix strategy/

I added a workflow_dispatch just to be able to trigger the workflow on my own to see of any potential errors. Seems like theirs some packages blocking this from being merged but they are actively working on 3.12 support: a good example of this is https://github.com/ray-project/ray/pull/45621

BBBmau commented 4 weeks ago

Latest commits pins ray to be 2.24.0, this was just released and contains support for 3.12

QuanyiLi commented 3 weeks ago

@pengzhenghao I canceled the dependency to ray, as it currently blocks the CI. Another thing is that MetaDrive doesn't mainly rely on it. It is only for the example scripts. If ppl really want to run them, they can install ray on their own.

@BBBmau It seems there is something wrong when syncing with the main repo, some fixings for CI are not merged to this PR. But no worry, I fixed this with some side stuff. Now, all CI passes for Python3.12. So I think we are ready to go.

adeebshihadeh commented 3 weeks ago

@QuanyiLi We're very interested in making openpilot accessible to run on any Linux or macOS PC, and MetaDrive is one of our most complicated dependencies for openpilot.

Are you guys interested in PRs to get the minimum dependencies down for running MetaDrive? Currently, it looks like a whole bunch of the required ones are development dependencies and not runtime dependencies. https://github.com/metadriverse/metadrive/blob/05ec6c8ea9a9fc77742b8af9967e63b43b4abaae/setup.py#L39