Skip to content

support python 3.12 and 3.13 #5304

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

cg505
Copy link
Collaborator

@cg505 cg505 commented Apr 21, 2025

Fix #3680.

The version of ray we are using does not support 3.12+, but on the client side we only need ray for the old provisioner. Exclude these clouds from skypilot[all] as well as vast due to a dependency issue (vast-ai/vast-sdk#6).

Once you do this, everything seems to work okay. We should smoke test on the new Python versions though.

Tested (run the relevant ones):

  • Code formatting: install pre-commit (auto-check on commit) or bash format.sh
  • Any manual or new tests for this PR (please specify below)
  • All smoke tests: /smoke-test (CI) or pytest tests/test_smoke.py (local)
  • Relevant individual tests: /smoke-test -k test_name (CI) or pytest tests/test_smoke.py::test_name (local)
  • Backward compatibility: /quicktest-core (CI) or pytest tests/smoke_tests/test_backward_compat.py (local)

'sudo sed -i "s/mesg n/tty -s \&\& mesg n/" ~/.profile;'
'sudo sed -i "s/mesg n/tty -s \\&\\& mesg n/" ~/.profile;'
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Starting in Python 3.12, there is a warning `.../sky/provision/docker_utils.py:333: SyntaxWarning: invalid escape sequence '&'.
This should be what's intended.

@cg505
Copy link
Collaborator Author

cg505 commented Apr 21, 2025

@romilbhardwaj do you want this in 0.9.0?

@cg505 cg505 force-pushed the py-version-upgrade branch from 0de0d37 to d0e3ad0 Compare April 21, 2025 23:59
@cg505 cg505 requested a review from romilbhardwaj April 22, 2025 02:14
Copy link
Collaborator

@Michaelvll Michaelvll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @cg505! Can we run some smoke tests that test custom docker images?

if sys.version_info >= (3, 12):
# The version of ray we use does not work with >= 3.12, so avoid clouds
# that require ray.
clouds_for_all -= {'ibm', 'docker', 'scp'}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we keep this at the top as a constant?

@cg505
Copy link
Collaborator Author

cg505 commented Apr 22, 2025

PYTHON_VERSION=3.11 /smoke-test
https://buildkite.com/skypilot-1/smoke-tests/builds/768

@cg505
Copy link
Collaborator Author

cg505 commented Apr 22, 2025

PYTHON_VERSION=3.12 /smoke-test
https://buildkite.com/skypilot-1/smoke-tests/builds/769

@cg505
Copy link
Collaborator Author

cg505 commented Apr 22, 2025

PYTHON_VERSION=3.13 /smoke-test
https://buildkite.com/skypilot-1/smoke-tests/builds/770

@cg505
Copy link
Collaborator Author

cg505 commented Apr 22, 2025

PYTHON_VERSION=3.7 /smoke-test
https://buildkite.com/skypilot-1/smoke-tests/builds/771

@cg505
Copy link
Collaborator Author

cg505 commented Apr 24, 2025

don't merge, need to look at smoke test failures

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Python 3.12 support
2 participants