Skip to content

Commit 4c4b774

Browse files
[ray] python 3.12 (ray-project#45621)
Add python 3.12 wheel support. Please follow https://docs.google.com/document/d/1-wmTLYwDA9QOHZRQ5IeUamyaTi3J0JorxvlQDbzodys/edit for more details on the roll out phase for this support. TL;DR; this PR will support python 3.12 as a nightly wheel; other release artifacts will take more work Related issue: ray-project#40211 Test: - CI Signed-off-by: can <can@anyscale.com> Co-authored-by: Philipp Moritz <pcmoritz@gmail.com>
1 parent 679a2ac commit 4c4b774

File tree

9 files changed

+19
-3
lines changed

9 files changed

+19
-3
lines changed

.buildkite/build.rayci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ steps:
1212
- "3.9"
1313
- "3.10"
1414
- "3.11"
15+
- "3.12"
1516
depends_on:
1617
- manylinux
1718
- forge

.buildkite/core.rayci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ steps:
3535
- "3.9"
3636
- "3.10"
3737
- "3.11"
38+
- "3.12"
3839
env:
3940
PYTHON_VERSION: "{{matrix}}"
4041
EXTRA_DEPENDENCY: core
@@ -243,6 +244,7 @@ steps:
243244
- "3.9"
244245
- "3.10"
245246
- "3.11"
247+
- "3.12"
246248

247249
# cpp tests
248250
- label: ":ray: core: cpp tests"

.buildkite/windows.rayci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ steps:
2626
- "3.9"
2727
- "3.10"
2828
- "3.11"
29+
- "3.12"
2930
depends_on: windowsbuild
3031

3132
- label: ":ray: core: :windows: cpp tests"

ci/env/install-dependencies.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,11 @@ install_miniconda() {
160160
)
161161
fi
162162

163-
# Install mpi4py
164-
"${WORKSPACE_DIR}"/ci/suppress_output conda install -c anaconda mpi4py -y
163+
if [[ "${PYTHON-}" != "3.12" ]]; then
164+
# Install mpi4py as a test dependency for Python <3.12; currently mpi4py is not
165+
# available for Python 3.12
166+
"${WORKSPACE_DIR}"/ci/suppress_output conda install -c anaconda mpi4py -y
167+
fi
165168

166169
command -V python
167170
test -x "${CONDA_PYTHON_EXE}" # make sure conda is activated

ci/ray_ci/builder_container.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class PythonVersionInfo(TypedDict):
2020
"3.9": PythonVersionInfo(bin_path="cp39-cp39"),
2121
"3.10": PythonVersionInfo(bin_path="cp310-cp310"),
2222
"3.11": PythonVersionInfo(bin_path="cp311-cp311"),
23+
"3.12": PythonVersionInfo(bin_path="cp312-cp312"),
2324
}
2425
DEFAULT_PYTHON_VERSION = "3.9"
2526
DEFAULT_BUILD_TYPE = "optimized"

ci/ray_ci/container.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"BUILDKITE_LABEL",
3838
"BUILDKITE_BAZEL_CACHE_URL",
3939
"BUILDKITE_PIPELINE_ID",
40+
"BUILDKITE_PULL_REQUEST",
4041
]
4142
_RAYCI_BUILD_ID = os.environ.get("RAYCI_BUILD_ID", "unknown")
4243

python/build-wheel-macos.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ DOWNLOAD_DIR=python_downloads
1010

1111
NODE_VERSION="14"
1212

13-
PY_MMS=("3.9" "3.10" "3.11")
13+
PY_MMS=("3.9" "3.10" "3.11" "3.12")
1414

1515
if [[ -n "${SKIP_DEP_RES}" ]]; then
1616
./ci/env/install-bazel.sh

python/build-wheel-manylinux2014.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ PYTHON_VERSIONS=(
1010
"py39 cp39-cp39"
1111
"py310 cp310-cp310"
1212
"py311 cp311-cp311"
13+
"py312 cp312-cp312"
1314
)
1415

1516
# Add the repo folder to the safe.dictory global variable to avoid the failure

python/ray/tests/test_mpi.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ def run():
4646

4747

4848
@pytest.mark.skipif(sys.platform != "linux", reason="Only test MPI on linux.")
49+
@pytest.mark.skipif(
50+
sys.version_info < (3, 12), reason="MPI not yet supported for python 3.12+"
51+
)
4952
def test_mpi_func_pi(change_test_dir, ray_start_regular):
5053
@ray.remote(
5154
runtime_env={
@@ -63,6 +66,9 @@ def calc_pi():
6366

6467

6568
@pytest.mark.skipif(sys.platform != "linux", reason="Only test MPI on linux.")
69+
@pytest.mark.skipif(
70+
sys.version_info < (3, 12), reason="MPI not yet supported for python 3.12+"
71+
)
6672
def test_mpi_actor_pi(change_test_dir, ray_start_regular):
6773
@ray.remote(
6874
runtime_env={

0 commit comments

Comments
 (0)