Skip to content

Commit 20ec9cb

Browse files
committed
fix: Fixed pre-commit issues in all files
1 parent a70c200 commit 20ec9cb

File tree

8 files changed

+494
-378
lines changed

8 files changed

+494
-378
lines changed

_helper_functions.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,22 @@
88
from packaging.requirements import Requirement
99

1010

11-
def print_color(text:str, color:str = Fore.BLUE):
11+
def print_color(text: str, color: str = Fore.BLUE):
1212
"""Print colored text specified by color argument based on colorama
13-
- default color BLUE
13+
- default color BLUE
1414
"""
15-
print(f'{color}', f'{text}', Style.RESET_ALL)
15+
print(f"{color}", f"{text}", Style.RESET_ALL)
1616

1717

18-
def merge_requirements(requirement:Requirement, another_req:Requirement) -> Requirement:
18+
def merge_requirements(requirement: Requirement, another_req: Requirement) -> Requirement:
1919
"""Merges two requirements into one requirement."""
20-
new_ver_specifier = ''
21-
new_markers = ''
20+
new_ver_specifier = ""
21+
new_markers = ""
2222
if requirement.specifier and another_req.specifier:
23-
if not another_req.marker and ('==' not in str(requirement.specifier)
24-
and '!=' not in str(requirement.specifier)):
25-
new_ver_specifier = f'{requirement.specifier},{another_req.specifier}'
23+
if not another_req.marker and (
24+
"==" not in str(requirement.specifier) and "!=" not in str(requirement.specifier)
25+
):
26+
new_ver_specifier = f"{requirement.specifier},{another_req.specifier}"
2627
else:
2728
new_ver_specifier = another_req.specifier
2829
elif requirement.specifier and not another_req.specifier:
@@ -31,15 +32,15 @@ def merge_requirements(requirement:Requirement, another_req:Requirement) -> Requ
3132
new_ver_specifier = another_req.specifier
3233

3334
if requirement.marker and another_req.marker:
34-
new_markers = f'({requirement.marker}) and ({another_req.marker})'
35+
new_markers = f"({requirement.marker}) and ({another_req.marker})"
3536
elif requirement.marker and not another_req.marker:
3637
new_markers = requirement.marker
3738
elif not requirement.marker and another_req.marker:
3839
new_markers = another_req.marker
3940

4041
# construct new requirement
4142
new_requirement = Requirement(
42-
f'{requirement.name}{new_ver_specifier}' + (f'; {new_markers}' if new_markers else '')
43+
f"{requirement.name}{new_ver_specifier}" + (f"; {new_markers}" if new_markers else "")
4344
)
4445

4546
return new_requirement

0 commit comments

Comments
 (0)