Skip to content

Commit

Permalink
Fix flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
hnformentin committed Feb 3, 2023
1 parent f5da2e2 commit 4c83f86
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion komodo/matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def get_matrix_base(release):
inverse of format_release for actual, concrete matrix releases.
Hard-coded the suffix pattern '-py..-rhel.' or '-py...-rhel.'"""

suffix = format_release("", "rhel[0-9]", "py\d{2,3}")
suffix = format_release("", "rhel[0-9]", r"py\d{2,3}")
if re.search(suffix, release):
return re.split(suffix, release)[0]
# no matrix suffix at all
Expand Down
9 changes: 4 additions & 5 deletions komodo/release_transpiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,21 +59,20 @@ def _check_consistency_in_versions(versions, pkg_name, rhel_ver, py_ver):
if "rhel" in first_level_versions[0]:
# Both rhel and python versions can have different versions
if rhel_ver not in first_level_versions:
raise KeyError(
f"Rhel version {rhel_ver} is not found for the package {pkg_name}."
)
raise KeyError(f"Rhel version {rhel_ver} not found in package {pkg_name}.")
second_level_versions = []
for version_py in versions[rhel_ver]:
second_level_versions.append(version_py)
if py_ver not in second_level_versions:
raise KeyError(
f"Python version {py_ver} is not found for the package {pkg_name} in rhel version {rhel_ver}."
f"Python version {py_ver} not found in "
f"package {pkg_name}, rhel version {rhel_ver}."
)
elif "py" in first_level_versions[0]:
# Only python has different versions
if py_ver not in first_level_versions:
raise KeyError(
f"Python version {py_ver} is not found for the package {pkg_name}."
f"Python version {py_ver} not found in " f"package {pkg_name}."
)


Expand Down
2 changes: 1 addition & 1 deletion tests/test_release_transpiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ def test_validate_versions_in_args_with_release_file(coords):
try:
transpile_releases(release_file, os.getcwd(), coords)
except KeyError as exception_info:
assert "not found for the package" in str(exception_info)
assert "not found in package" in str(exception_info)

0 comments on commit 4c83f86

Please sign in to comment.