Skip to content

Commit

Permalink
global: update pyyaml version
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions authored and PascalEgn committed Sep 17, 2024
1 parent 19a61eb commit e3cff05
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion scripts/normalize_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def _is_leaf(value):
def normalize_yaml(file_name):
print('Normalizing', file_name, '...')
with open(file_name, 'r') as file_stream:
schema = yaml.load(file_stream)
schema = yaml.full_load(file_stream)

schema = process_tree(schema)
yaml_schema = yaml.dump(schema, **DUMPER_OPTIONS)
Expand Down
10 changes: 5 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def _resolve_json_schema(json_schema, path):
subschema_path = os.path.splitext(subschema_path)[0]
with open(subschema_path + '.yml', 'rb') as yaml_fd:
raw_data = yaml_fd.read()
data = yaml.load(raw_data)
data = yaml.full_load(raw_data)
data = _resolve_json_schema(
data, os.path.join(path, os.path.dirname(json_schema[key]))
)
Expand All @@ -86,7 +86,7 @@ def _yaml2json(yaml_file, json_file):

with open(yaml_file, 'rb') as yaml_fd:
raw_data = yaml_fd.read()
data = yaml.load(raw_data)
data = yaml.full_load(raw_data)
with open(json_file, 'w') as json_fd:
json.dump(data, json_fd, indent=4, separators=(',', ': '), sort_keys=True)
json_fd.write('\n')
Expand Down Expand Up @@ -156,7 +156,7 @@ def _generate_json_schemas():
_yaml2json(yaml_file=yaml_file, json_file=json_file)


build_requires = ['pyyaml>=5.3.0']
build_requires = ['pyyaml>=6.0,<7.0']

tests_require = [
'check-manifest',
Expand Down Expand Up @@ -216,7 +216,7 @@ def do_setup():
'isbnid',
'inspire-utils~=3.0,>=3.0.0',
'isodate',
'pyyaml==5.3.0',
'pyyaml>=6.0,<7.0',
'pytz',
'rfc3987',
'six',
Expand All @@ -233,7 +233,7 @@ def do_setup():
name='inspire-schemas',
package_data={'': ['*.json', 'CHANGELOG', 'AUTHORS']},
packages=find_packages(),
setup_requires=['pyyaml==5.3.0'],
setup_requires=['pyyaml>=6.0,<7.0'],
url=URL,
bugtracker_url=URL + '/issues/',
zip_safe=False,
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
def load_file(file_name):
path = os.path.join(FIXTURES_PATH, file_name)
with open(path) as input_data:
data = yaml.load(input_data.read())
data = yaml.full_load(input_data.read())

return data

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_parsers_crossref.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def get_parsed_from_file(filename):
"""A dictionary holding the parsed elements of the record."""
path = get_test_suite_path('crossref', filename)
with open(path) as f:
aps_dict = yaml.load(f)
aps_dict = yaml.full_load(f)

return aps_dict

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_parsers_elsevier.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def get_parsed_from_file(filename):
"""A dictionary holding the parsed elements of the record."""
path = get_test_suite_path('elsevier', filename)
with open(path) as f:
elsevier_expected_dict = yaml.load(f)
elsevier_expected_dict = yaml.full_load(f)

return elsevier_expected_dict

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_parsers_jats.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def get_parsed_from_file(filename):
"""A dictionary holding the parsed elements of the record."""
path = get_test_suite_path('aps', filename)
with open(path) as f:
aps_expected_dict = yaml.load(f)
aps_expected_dict = yaml.full_load(f)

return aps_expected_dict

Expand Down

0 comments on commit e3cff05

Please sign in to comment.