Skip to content

Commit

Permalink
Merge pull request #465 from PascalEgn/update-pyyaml-version
Browse files Browse the repository at this point in the history
global: update pyyaml version
  • Loading branch information
PascalEgn authored Sep 20, 2024
2 parents 19a61eb + d11b044 commit f96e645
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 33 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Install python dependencies
run: |
${{ matrix.pip }} install --user --upgrade pip
${{ matrix.pip }} --no-cache-dir install --user setuptools wheel "urllib3==1.25.11"
${{ matrix.pip }} --no-cache-dir install --user setuptools wheel
${{ matrix.pip }} --no-cache-dir install --user -e .[tests,docs]
- name: Show python dependencies
Expand Down Expand Up @@ -108,7 +108,7 @@ jobs:
- name: Install python dependencies
run: |
python -m pip install --upgrade pip
pip --no-cache-dir install setuptools wheel "urllib3==1.25.11"
pip --no-cache-dir install setuptools wheel
pip --no-cache-dir install -e .[tests,docs]
- name: Show python dependencies
Expand Down
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
53 changes: 27 additions & 26 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,28 @@ 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',
]

install_requires=[
'bump2version~=0.0,<1; python_version == "2.7"',
'bump2version~=1.0; python_version >= "3"',
'bleach~=3.0,>=3.2.1',
'Unidecode~=1.0,>=1.0.22',
'jsonschema~=2.0,>=2.6.0',
'inspire-idutils==1.2.4; python_version == "2.7"',
'idutils~=1.2,>=1.2.1; python_version >= "3"',
'isbnid',
'inspire-utils',
'isodate',
'pyyaml>=6.0,<7.0',
'pytz',
'rfc3987',
'six',
'scrapy',
'pylatexenc',
]

tests_require = [
'check-manifest',
Expand All @@ -174,7 +195,7 @@ def _generate_json_schemas():
]

docs_require = [
'jsonschema2rst>=0.1',
'jsonschema2rst>=0.1.6',
'Sphinx',
]

Expand Down Expand Up @@ -205,35 +226,15 @@ def do_setup():
description='Inspire JSON schemas and utilities to use them.',
long_description="Inspire JSON schemas and utilities to use them.",
long_description_content_type='text/plain',
install_requires=[
'bump2version~=0.0,<1; python_version == "2.7"',
'bump2version~=1.0; python_version >= "3"',
'bleach~=3.0,>=3.2.1',
'Unidecode~=1.0,>=1.0.22',
'jsonschema~=2.0,>=2.6.0',
'inspire-idutils==1.2.4; python_version == "2.7"',
'idutils~=1.2,>=1.2.1; python_version >= "3"',
'isbnid',
'inspire-utils~=3.0,>=3.0.0',
'isodate',
'pyyaml==5.3.0',
'pytz',
'rfc3987',
'six',
# requests requires a urllib3 version <1.26 but not 1.25.0 and 1.25.1
# we pin it down here to solve dependency problems
'urllib3>=1.21.1,<1.26,!=1.25.0,!=1.25.1',
'scrapy',
'pylatexenc',
],
install_requires=install_requires,
tests_require=tests_require,
extras_require=extras_require,
build_requires=build_requires,
license='GPLv2',
name='inspire-schemas',
package_data={'': ['*.json', 'CHANGELOG', 'AUTHORS']},
packages=find_packages(),
setup_requires=['pyyaml==5.3.0'],
setup_requires=install_requires,
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 f96e645

Please sign in to comment.