Skip to content

Commit e895fa9

Browse files
zhuolyangmuyr
authored andcommitted
fix: use PySide6 for Maya 2025 (Python 3.11+) compatibility
- Add Python version detection in Maya test script - Use PySide6>=6.2.0 for Python 3.11+ (Maya 2025) - Keep PySide2>=5.15.2.1 for Python 3.10 and below (Maya 2022-2024) - Resolve PySide2 version compatibility issue with Python 3.11 Maya 2025 uses Python 3.11.4, but PySide2 5.15.2.1 only supports up to Python 3.10. This change ensures the correct Qt binding is installed based on the Python version in each Maya Docker container. Signed-off-by: yangzhuo <zhuolyang@tencent.com>
1 parent 5947cc6 commit e895fa9

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

nox_actions/maya_test.py

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,26 @@ def maya_test(session: nox.Session) -> None:
111111
subprocess.check_call([sys.executable, "-m", "pip", "install", "qtpy>=2.3.1"])
112112
print("✓ qtpy installed successfully")
113113
114-
# Install PySide2 if not available
115-
try:
116-
import PySide2
117-
print("✓ PySide2 already available")
118-
except ImportError:
119-
print("Installing PySide2...")
120-
subprocess.check_call([sys.executable, "-m", "pip", "install", "PySide2>=5.15.2.1"])
121-
print("✓ PySide2 installed successfully")
114+
# Install appropriate Qt binding based on Python version
115+
python_version = sys.version_info
116+
if python_version >= (3, 11):
117+
# Python 3.11+ should use PySide6
118+
try:
119+
import PySide6
120+
print("✓ PySide6 already available")
121+
except ImportError:
122+
print("Installing PySide6 for Python 3.11+...")
123+
subprocess.check_call([sys.executable, "-m", "pip", "install", "PySide6>=6.2.0"])
124+
print("✓ PySide6 installed successfully")
125+
else:
126+
# Python 3.10 and below can use PySide2
127+
try:
128+
import PySide2
129+
print("✓ PySide2 already available")
130+
except ImportError:
131+
print("Installing PySide2...")
132+
subprocess.check_call([sys.executable, "-m", "pip", "install", "PySide2>=5.15.2.1"])
133+
print("✓ PySide2 installed successfully")
122134
123135
except Exception as e:
124136
print(f"✗ Failed to install dependencies: {{e}}")

0 commit comments

Comments
 (0)