Skip to content

Commit

Permalink
SG-34462 Test CI with Python 3.11 (#50)
Browse files Browse the repository at this point in the history
* Python 3.11 POC

* Add debug info

* Use PySide6 for 3.11 only

* Use Qt bindings

* Use PySide6-Essentials bindings

* Fix typo

* PyQt6-Qt6 6.6.1

* Use PySide instead of Qt

* Fix import

* Install libegl1

* Sudo, make me a 🥪

* Uncomment previous tests

* Supress deprecation warnings from pytest-nunit

* Update code style validation versions

* Remove fix version for pytest-nunit

* Attempt

* Revert

* Fix attrs version for tk-framework-desktopserver

* Undo fix attrs version for tk-framework-desktopserver
  • Loading branch information
carlos-villavicencio-adsk authored Mar 28, 2024
1 parent 81f4907 commit 78ba8a7
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 9 deletions.
5 changes: 0 additions & 5 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,9 @@ pr:
variables:
- group: deploy-secrets

# Invoke the build pipeline template with Qt.py has an extra dependency so
# the tests can run properly.
jobs:
- template: build-pipeline.yml
parameters:
# There's a test inside this repo that requires Qt.py
extra_test_dependencies:
- Qt.py
# This has the side effect that it ensures we can clone the UI automation
# repo with the SSH key
has_ui_tests: true
Expand Down
5 changes: 3 additions & 2 deletions internal/code-style-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:
# Use Python 3 for validating the code.
- task: UsePythonVersion@0
inputs:
versionSpec: '3.9'
displayName: Use Python 3.9
versionSpec: '3.10'
displayName: Use Python 3.10

- template: pip-install-packages.yml
parameters:
Expand All @@ -44,5 +44,6 @@ jobs:
- bash: pre-commit run --all
displayName: Validate code

# Validate documentation with PySide2 and Python 3.10
- bash: tk-docs-preview --build-only --verbose
displayName: Validate documentation
3 changes: 3 additions & 0 deletions internal/run-tests-with.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ jobs:
/usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
echo ">>> Started Xvfb"
displayName: Start Xvfb
# Install libegl1 required for PySide6
- bash: sudo apt install libegl1
displayName: Install libegl1

# Repositories using our build pipeline outside of the
# shotgunsoftware organization should not be able to run our UI automation
Expand Down
44 changes: 44 additions & 0 deletions internal/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -190,3 +190,47 @@ jobs:
tk_core_ref: ${{ parameters.tk_core_ref }}
post_tests_steps: ${{ parameters.post_tests_steps }}
has_unit_tests: ${{ parameters.has_unit_tests }}

# -------------------------
- template: run-tests-with.yml
parameters:
image_name: 'windows-2022'
python_version: 3.11
qt_wrapper: PySide6==6.6.1
job_name: "Windows"
# pass through all parameters
extra_test_dependencies: ${{ parameters.extra_test_dependencies }}
tk_toolchain_ref: ${{ parameters.tk_toolchain_ref }}
additional_repositories: ${{ parameters.additional_repositories }}
tk_core_ref: ${{ parameters.tk_core_ref }}
post_tests_steps: ${{ parameters.post_tests_steps }}
has_unit_tests: ${{ parameters.has_unit_tests }}
ui_automation_ref: ${{ parameters.ui_automation_ref }}

- template: run-tests-with.yml
parameters:
image_name: 'macOS-12'
python_version: 3.11
qt_wrapper: PySide6==6.6.1
job_name: "macOS"
# pass through all parameters.
extra_test_dependencies: ${{ parameters.extra_test_dependencies }}
tk_toolchain_ref: ${{ parameters.tk_toolchain_ref }}
additional_repositories: ${{ parameters.additional_repositories }}
tk_core_ref: ${{ parameters.tk_core_ref }}
post_tests_steps: ${{ parameters.post_tests_steps }}
has_unit_tests: ${{ parameters.has_unit_tests }}

- template: run-tests-with.yml
parameters:
image_name: 'ubuntu-22.04'
qt_wrapper: PySide6==6.6.1
python_version: 3.11
job_name: "Linux"
# pass through all parameters.
extra_test_dependencies: ${{ parameters.extra_test_dependencies }}
tk_toolchain_ref: ${{ parameters.tk_toolchain_ref }}
additional_repositories: ${{ parameters.additional_repositories }}
tk_core_ref: ${{ parameters.tk_core_ref }}
post_tests_steps: ${{ parameters.post_tests_steps }}
has_unit_tests: ${{ parameters.has_unit_tests }}
7 changes: 5 additions & 2 deletions tests/test_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@

import sys

# Qt.py should have been installed by the build pipeline.
from Qt import QtWidgets
# We don't have access to sgtk. Import directly from the environment.
try:
from PySide2 import QtWidgets # noqa
except ImportError:
from PySide6 import QtWidgets # noqa


def test_qt():
Expand Down

0 comments on commit 78ba8a7

Please sign in to comment.