From 97d2ba37cc8749b147694d0dd5f9e7127e1b6919 Mon Sep 17 00:00:00 2001 From: sunyab Date: Tue, 24 Jan 2023 11:45:39 -0800 Subject: [PATCH] Add support for Python 3.10 to usd-core PyPI package This change adds 3.10 to the PyPI build matrix on Azure. Doing so required manually installing CMake 3.24 on top of the manylinux2014 docker image we currently use, since 3.24+ is required for Python 3.10. Attempting to use a newer docker image caused crashes when using the generated wheels for some unknown reason. (Internal change: 2260771) --- azure-pypi-pipeline.yml | 22 ++++++++++++++++++++++ build_scripts/pypi/docker/Dockerfile | 9 +++++++++ build_scripts/pypi/package_files/setup.py | 2 +- 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/azure-pypi-pipeline.yml b/azure-pypi-pipeline.yml index dc3e576ff9..239bb34b4f 100644 --- a/azure-pypi-pipeline.yml +++ b/azure-pypi-pipeline.yml @@ -51,6 +51,9 @@ stages: Python39: PYTHON_INTERPRETER: /opt/python/cp39-cp39/bin/python PYTHON_TAG: cp39 + Python310: + PYTHON_INTERPRETER: /opt/python/cp310-cp310/bin/python + PYTHON_TAG: cp310 timeoutInMinutes: 90 pool: vmImage: Ubuntu-20.04 @@ -116,6 +119,9 @@ stages: Python39: PYTHON_VERSION_SPEC: 3.9 PYTHON_TAG: cp39 + Python310: + PYTHON_VERSION_SPEC: 3.10 + PYTHON_TAG: cp310 timeoutInMinutes: 90 pool: vmImage: 'windows-2019' @@ -171,6 +177,10 @@ stages: PYTHON_VERSION_SPEC: 3.9 PYTHON_INTERPRETER: python3.9 PYTHON_TAG: cp39 + Python310: + PYTHON_VERSION_SPEC: 3.10 + PYTHON_INTERPRETER: python3.10 + PYTHON_TAG: cp310 timeoutInMinutes: 180 pool: vmImage: 'macOS-11' @@ -264,6 +274,10 @@ stages: PYTHON_VERSION_SPEC: 3.9 IMAGE: 'Ubuntu-20.04' PYTHON_INTERPRETER: python3 + Linux_Python310: + PYTHON_VERSION_SPEC: 3.10 + IMAGE: 'Ubuntu-20.04' + PYTHON_INTERPRETER: python3 Windows_Python36: PYTHON_VERSION_SPEC: 3.6 IMAGE: 'windows-2019' @@ -280,6 +294,10 @@ stages: PYTHON_VERSION_SPEC: 3.9 IMAGE: 'windows-2019' PYTHON_INTERPRETER: python + Windows_Python310: + PYTHON_VERSION_SPEC: 3.10 + IMAGE: 'windows-2019' + PYTHON_INTERPRETER: python Mac_Python36: PYTHON_VERSION_SPEC: 3.6 IMAGE: 'macOS-11' @@ -296,6 +314,10 @@ stages: PYTHON_VERSION_SPEC: 3.9 IMAGE: 'macOS-11' PYTHON_INTERPRETER: python3 + Mac_Python310: + PYTHON_VERSION_SPEC: 3.10 + IMAGE: 'macOS-11' + PYTHON_INTERPRETER: python3 timeoutInMinutes: 10 pool: vmImage: '$(IMAGE)' diff --git a/build_scripts/pypi/docker/Dockerfile b/build_scripts/pypi/docker/Dockerfile index 0de17d8c02..836c9868e7 100644 --- a/build_scripts/pypi/docker/Dockerfile +++ b/build_scripts/pypi/docker/Dockerfile @@ -4,4 +4,13 @@ ENV LANG en_US.UTF-8 ENV LANGUAGE en_US:en WORKDIR /opt/USD + +# XXX: +# The above manylinux2014 image contains CMake 3.20, but we require +# 3.24+ for Python 3.10 support. Newer images include later cmake +# versions but for some reason (possibly the use of gcc 10?) wheels +# created from these images crash in TBB. So for now, we use this +# older image but install a newer CMake. +RUN pipx install --force cmake==3.24.3 + CMD bash diff --git a/build_scripts/pypi/package_files/setup.py b/build_scripts/pypi/package_files/setup.py index a77fdd3e9b..bae219fe55 100644 --- a/build_scripts/pypi/package_files/setup.py +++ b/build_scripts/pypi/package_files/setup.py @@ -151,5 +151,5 @@ def windows(): "Environment :: Console", "Topic :: Multimedia :: Graphics", ], - python_requires='>=3.6, <3.10', + python_requires='>=3.6, <3.11', )