Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 11 additions & 14 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@ jobs:
strategy:
matrix:
# Define all the platform/python version we need
MacPython37:
MacPython311:
platform: 'osx' # Short name for us
imageName: 'macOS-10.15'
python.version: '3.7'
WinPython37:
imageName: 'macOS-latest'
python.version: '3.11'
WinPython311:
platform: 'win' # Short name for us
imageName: 'windows-2019'
python.version: '3.7'
LinuxPython37:
imageName: 'windows-latest'
python.version: '3.11'
LinuxPython311:
platform: 'linux' # Short name for us
imageName: 'ubuntu-latest'
python.version: '3.7'
python.version: '3.11'
maxParallel: 1

pool:
Expand Down Expand Up @@ -84,12 +84,9 @@ jobs:
inputs:
Contents: |
.git
resources/packagevenv_osx_2
resources/packagevenv_osx_3
resources/packagevenv_windows_2
resources/packagevenv_windows_3
resources/packagevenv_linux_2
resources/packagevenv_linux_3
resources/packagevenv_osx_3.11
resources/packagevenv_windows_3.11
resources/packagevenv_linux_3.11

# Archive files
# Compress files into .7z, .tar.gz, or .zip
Expand Down
17 changes: 9 additions & 8 deletions framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
# file included in this repository.

"""
Framework containing PySide2 distributions for the Unreal engine
Framework containing PySide distributions for the Unreal engine

Because Unreal does not include PySide2/Qt distributions but does use its own
Because Unreal does not include PySide/Qt distributions but does use its own
version of Python, we have to distribute full versions for the engine to function.
"""

Expand All @@ -31,15 +31,15 @@ def init_framework(self):
Something similar to what `virtualenv` does is done when this framework is
loaded by SG TK.
"""
self.log_debug("%s: Initializing UnrealQtFramework..." % self)
self.logger.debug("%s: Initializing UnrealQtFramework..." % self)

# Check if PySide is already available, do nothing if it is the case
try:
from sgtk.platform.qt import QtCore # noqa
self.log_debug("Qt is already available, not activating any custom package.")
self.logger.debug("Qt is already available, not activating any custom package.")
return
except ImportError as e:
self.log_debug("Qt is not available: %s, activating custom package." % e)
self.logger.debug("Qt is not available: %s, activating custom package." % e)
pass
# Remap the platform name to our names
pname = self.platform_name()
Expand All @@ -53,13 +53,14 @@ def init_framework(self):
# Copied over from activate_this.py script which does not exist anymore
# from Python 3.
python_major = sys.version_info[0] # 2 or 3
python_minor = sys.version_info[1] # 6, 7, 8, etc

base_path = os.path.realpath(
os.path.join(
os.path.dirname(__file__),
"python",
"vendors",
"py%d" % python_major,
"py%d.%d" % (python_major, python_minor),
pname,
)
)
Expand All @@ -74,7 +75,7 @@ def init_framework(self):
"lib"
)
)
python_pattern = r"^python%d\.\d$" % python_major
python_pattern = r"^python%d\.\d+$" % python_major
for folder in lib_folders:
if re.match(python_pattern, folder):
break
Expand Down Expand Up @@ -108,7 +109,7 @@ def init_framework(self):
sys.prefix = base_path

def destroy_framework(self):
self.log_debug("%s: Destroying UnrealQtFramework..." % self)
self.logger.debug("%s: Destroying UnrealQtFramework..." % self)

@classmethod
def platform_name(cls):
Expand Down
2 changes: 1 addition & 1 deletion hooks/core/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def populate_bundle_cache_entry(self, destination, descriptor, **kwargs):
for asset in response_d["assets"]:
name = asset["name"]
m = re.match(
r"%s-py\d.\d-%s.zip" % (version, pname),
r"%s-py\d.\d+-%s.zip" % (version, pname),
name
)
if m:
Expand Down
17 changes: 12 additions & 5 deletions resources/build_packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,22 @@ echo "Detecting Python version..."
python_version=$($python_cmd --version 2>&1)
# 2 or 3
python_major_version=${python_version:7:1}
if [ -z $python_major_version ];
# 2 or 3
python_major_version=${python_version:7:1}
# Remove patch number from Python 3.9.17
no_patch=${python_version%\.*}
# 3.9
python_major_minor=${no_patch:7}

if [ -z $python_major_version ] || [ -z $python_major_minor ];
then
echo "Unable to detect python version, aborting"
exit 1
fi

echo "Detected python version ${python_major_version} from ${python_version}"
echo "Detected python version ${python_major_version} from ${python_version} (${python_major_minor})"

packagevenv="packagevenv_${platform_name}_${python_major_version}"
packagevenv="packagevenv_${platform_name}_${python_major_minor}"
if [ ! -d $packagevenv ]; then
if [ ${python_major_version} == 2 ];
then
Expand Down Expand Up @@ -200,8 +207,8 @@ if [ $do_build == 1 ]; then
fi
# Copy packages to their shipping destination
if [ -d ./${packagevenv} ]; then
mkdir -p ../python/vendors/py${python_major_version}
target="../python/vendors/py${python_major_version}/${platform_name}"
mkdir -p ../python/vendors/py${python_major_minor}
target="../python/vendors/py${python_major_minor}/${platform_name}"
if [ -d $target ]; then
echo "Deleting previous build in $target"
# Clean up git but don't fail if there is nothing matching
Expand Down
2 changes: 1 addition & 1 deletion resources/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
## The following requirements were added by pip --freeze:

PySide2==5.15.2
PySide6==6.7.0