Skip to content

Commit 836af40

Browse files
authored
Merge pull request #1 from GPLgithub/13673_py_updates
13673 py updates
2 parents 8228d8a + bcc916b commit 836af40

File tree

5 files changed

+34
-29
lines changed

5 files changed

+34
-29
lines changed

azure-pipelines.yml

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,18 @@ jobs:
2424
strategy:
2525
matrix:
2626
# Define all the platform/python version we need
27-
MacPython37:
27+
MacPython311:
2828
platform: 'osx' # Short name for us
29-
imageName: 'macOS-10.15'
30-
python.version: '3.7'
31-
WinPython37:
29+
imageName: 'macOS-latest'
30+
python.version: '3.11'
31+
WinPython311:
3232
platform: 'win' # Short name for us
33-
imageName: 'windows-2019'
34-
python.version: '3.7'
35-
LinuxPython37:
33+
imageName: 'windows-latest'
34+
python.version: '3.11'
35+
LinuxPython311:
3636
platform: 'linux' # Short name for us
3737
imageName: 'ubuntu-latest'
38-
python.version: '3.7'
38+
python.version: '3.11'
3939
maxParallel: 1
4040

4141
pool:
@@ -84,12 +84,9 @@ jobs:
8484
inputs:
8585
Contents: |
8686
.git
87-
resources/packagevenv_osx_2
88-
resources/packagevenv_osx_3
89-
resources/packagevenv_windows_2
90-
resources/packagevenv_windows_3
91-
resources/packagevenv_linux_2
92-
resources/packagevenv_linux_3
87+
resources/packagevenv_osx_3.11
88+
resources/packagevenv_windows_3.11
89+
resources/packagevenv_linux_3.11
9390
9491
# Archive files
9592
# Compress files into .7z, .tar.gz, or .zip

framework.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
# file included in this repository.
44

55
"""
6-
Framework containing PySide2 distributions for the Unreal engine
6+
Framework containing PySide distributions for the Unreal engine
77
8-
Because Unreal does not include PySide2/Qt distributions but does use its own
8+
Because Unreal does not include PySide/Qt distributions but does use its own
99
version of Python, we have to distribute full versions for the engine to function.
1010
"""
1111

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

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

5758
base_path = os.path.realpath(
5859
os.path.join(
5960
os.path.dirname(__file__),
6061
"python",
6162
"vendors",
62-
"py%d" % python_major,
63+
"py%d.%d" % (python_major, python_minor),
6364
pname,
6465
)
6566
)
@@ -74,7 +75,7 @@ def init_framework(self):
7475
"lib"
7576
)
7677
)
77-
python_pattern = r"^python%d\.\d$" % python_major
78+
python_pattern = r"^python%d\.\d+$" % python_major
7879
for folder in lib_folders:
7980
if re.match(python_pattern, folder):
8081
break
@@ -108,7 +109,7 @@ def init_framework(self):
108109
sys.prefix = base_path
109110

110111
def destroy_framework(self):
111-
self.log_debug("%s: Destroying UnrealQtFramework..." % self)
112+
self.logger.debug("%s: Destroying UnrealQtFramework..." % self)
112113

113114
@classmethod
114115
def platform_name(cls):

hooks/core/bootstrap.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def populate_bundle_cache_entry(self, destination, descriptor, **kwargs):
138138
for asset in response_d["assets"]:
139139
name = asset["name"]
140140
m = re.match(
141-
r"%s-py\d.\d-%s.zip" % (version, pname),
141+
r"%s-py\d.\d+-%s.zip" % (version, pname),
142142
name
143143
)
144144
if m:

resources/build_packages.sh

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,15 +133,22 @@ echo "Detecting Python version..."
133133
python_version=$($python_cmd --version 2>&1)
134134
# 2 or 3
135135
python_major_version=${python_version:7:1}
136-
if [ -z $python_major_version ];
136+
# 2 or 3
137+
python_major_version=${python_version:7:1}
138+
# Remove patch number from Python 3.9.17
139+
no_patch=${python_version%\.*}
140+
# 3.9
141+
python_major_minor=${no_patch:7}
142+
143+
if [ -z $python_major_version ] || [ -z $python_major_minor ];
137144
then
138145
echo "Unable to detect python version, aborting"
139146
exit 1
140147
fi
141148

142-
echo "Detected python version ${python_major_version} from ${python_version}"
149+
echo "Detected python version ${python_major_version} from ${python_version} (${python_major_minor})"
143150

144-
packagevenv="packagevenv_${platform_name}_${python_major_version}"
151+
packagevenv="packagevenv_${platform_name}_${python_major_minor}"
145152
if [ ! -d $packagevenv ]; then
146153
if [ ${python_major_version} == 2 ];
147154
then
@@ -200,8 +207,8 @@ if [ $do_build == 1 ]; then
200207
fi
201208
# Copy packages to their shipping destination
202209
if [ -d ./${packagevenv} ]; then
203-
mkdir -p ../python/vendors/py${python_major_version}
204-
target="../python/vendors/py${python_major_version}/${platform_name}"
210+
mkdir -p ../python/vendors/py${python_major_minor}
211+
target="../python/vendors/py${python_major_minor}/${platform_name}"
205212
if [ -d $target ]; then
206213
echo "Deleting previous build in $target"
207214
# Clean up git but don't fail if there is nothing matching

resources/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
## The following requirements were added by pip --freeze:
22

3-
PySide2==5.15.2
3+
PySide6==6.7.0

0 commit comments

Comments
 (0)