Skip to content

Commit 9b3e02a

Browse files
authored
Update PyYAML dependency to version 6.0.1 (#1753)
Upgraded PyYAML from 5.1 to 6.0.1 to ensure compatibility with newer features and security updates. This change aligns with best practices for dependency management. Also added test for installing all packages in python 3.7
1 parent 1cbe8d4 commit 9b3e02a

File tree

6 files changed

+27
-7
lines changed

6 files changed

+27
-7
lines changed

.github/workflows/testing-pipeline.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,26 @@ jobs:
118118
export OPENCUE_RQD_PACKAGE_PATH="${{ needs.build_opencue_packages.outputs.opencue_rqd_path }}"
119119
pip install $OPENCUE_PROTO_PACKAGE_PATH $OPENCUE_PYCUE_PACKAGE_PATH $OPENCUE_PYOUTLINE_PACKAGE_PATH $OPENCUE_CUEADMIN_PACKAGE_PATH $OPENCUE_CUESUBMIT_PACKAGE_PATH $OPENCUE_RQD_PACKAGE_PATH
120120
121+
install_opencue_packages_3_7:
122+
needs: build_opencue_packages
123+
name: Test installing packages with python 3.7
124+
runs-on: ubuntu-22.04
125+
container: python:3.7
126+
steps:
127+
- name: Download a single artifact
128+
uses: actions/download-artifact@v4
129+
with:
130+
name: opencue_packages
131+
- name: Install package
132+
run: |
133+
export OPENCUE_PROTO_PACKAGE_PATH="${{ needs.build_opencue_packages.outputs.opencue_proto_path }}"
134+
export OPENCUE_PYCUE_PACKAGE_PATH="${{ needs.build_opencue_packages.outputs.opencue_pycue_path }}"
135+
export OPENCUE_PYOUTLINE_PACKAGE_PATH="${{ needs.build_opencue_packages.outputs.opencue_pyoutline_path }}"
136+
export OPENCUE_CUEADMIN_PACKAGE_PATH="${{ needs.build_opencue_packages.outputs.opencue_cueadmin_path }}"
137+
export OPENCUE_CUESUBMIT_PACKAGE_PATH="${{ needs.build_opencue_packages.outputs.opencue_cuesubmit_path }}"
138+
export OPENCUE_RQD_PACKAGE_PATH="${{ needs.build_opencue_packages.outputs.opencue_rqd_path }}"
139+
pip install $OPENCUE_PROTO_PACKAGE_PATH $OPENCUE_PYCUE_PACKAGE_PATH $OPENCUE_PYOUTLINE_PACKAGE_PATH $OPENCUE_CUEADMIN_PACKAGE_PATH $OPENCUE_CUESUBMIT_PACKAGE_PATH $OPENCUE_RQD_PACKAGE_PATH
140+
121141
test_python_2023:
122142
needs: build_opencue_packages
123143
name: Run Python Unit Tests (CY2023)

cuegui/cuegui/plugins/StuckFramePlugin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1509,7 +1509,7 @@ def finalize(self, frames):
15091509

15101510
else:
15111511
with open(yaml_path, 'r', encoding='utf-8') as yaml_ob:
1512-
old_dict = yaml.load(yaml_ob)
1512+
old_dict = yaml.load(yaml_ob, Loader=yaml.SafeLoader)
15131513

15141514
with open(yaml_path, 'w', encoding='utf-8') as yaml_ob:
15151515

@@ -1589,7 +1589,7 @@ def finalize(self, frames, show):
15891589

15901590
else:
15911591
with open(yaml_path, 'r', encoding='utf-8') as yaml_ob:
1592-
old_dict = yaml.load(yaml_ob)
1592+
old_dict = yaml.load(yaml_ob, Loader=yaml.SafeLoader)
15931593
with open(yaml_path, 'w', encoding='utf-8') as yaml_ob:
15941594
for key in frames_dict: # updates old dict
15951595
old_dict[key] = frames_dict[key]

pycue/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ name = "opencue_pycue"
1010
dynamic = ["version"]
1111
dependencies = [
1212
"opencue_proto",
13-
"PyYAML==5.1",
13+
"PyYAML==6.0.1",
1414
"six==1.16.0",
1515
"future==1.0.0"
1616
]

pyoutline/outline/io.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ def file_spec_constructor(loader, node):
445445
"""
446446
Unserializes a yamlized FileSpec.
447447
"""
448-
value = yaml.load(loader.construct_scalar(node), Loader=yaml.FullLoader)
448+
value = yaml.load(loader.construct_scalar(node), Loader=yaml.Loader)
449449
return FileSpec(value[0], **value[1])
450450

451451

pyoutline/outline/loader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def load_outline(path):
7676
ext = os.path.splitext(path)
7777
if ext[1] == ".yaml" or path.find("cue_archive") != -1:
7878
with open(path, encoding='utf-8') as file_object:
79-
ol = yaml.load(file_object, Loader=yaml.FullLoader)
79+
ol = yaml.load(file_object, Loader=yaml.Loader)
8080
Outline.current = ol
8181
if not isinstance(ol, Outline):
8282
raise outline.exception.OutlineException("The file %s did not produce "

pyoutline/outline/session.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def __load_session(self):
142142
logger.info("loading session: %s", session)
143143
with open(session, encoding='utf-8') as file_object:
144144
try:
145-
data = yaml.load(file_object, Loader=yaml.FullLoader)
145+
data = yaml.load(file_object, Loader=yaml.Loader)
146146
except Exception as exp:
147147
msg = "failed to load session from %s, %s"
148148
raise outline.exception.SessionException(msg % (session, exp))
@@ -345,7 +345,7 @@ def get_data(self, name, layer=None):
345345
logger.debug("opening data path for %s : %s", name, path)
346346
with open(path, encoding='utf-8') as file_object:
347347
try:
348-
return yaml.load(file_object, Loader=yaml.FullLoader)
348+
return yaml.load(file_object, Loader=yaml.Loader)
349349
except Exception as exp:
350350
msg = "failed to load yaml data from %s, %s"
351351
raise outline.exception.SessionException(msg % (path, exp))

0 commit comments

Comments
 (0)