Skip to content

Commit d4ce431

Browse files
MatthijsBurghar13pit
authored andcommitted
Apply black linting
1 parent 6ae7c1a commit d4ce431

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

installer/check_dependency_versions.py

+13-11
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@
88
from catkin_pkg.condition import evaluate_condition
99

1010
import rospkg
11+
1112
rospack = rospkg.RosPack()
1213
from collections import namedtuple
1314

14-
Dependency = namedtuple('Dependency', ['name', 'req_version', 'actual_version', 'comparator'])
15+
Dependency = namedtuple("Dependency", ["name", "req_version", "actual_version", "comparator"])
1516

1617

1718
def main() -> int:
@@ -29,7 +30,7 @@ def main() -> int:
2930
if value.req_version != "None" and value.req_version != value.actual_version:
3031
print(f"Package {value.name}, current version {value.actual_version}, required version {value.req_version}")
3132
mismatch_found = True
32-
#print("\n".join(dep))
33+
# print("\n".join(dep))
3334

3435
if mismatch_found:
3536
print("Mismatch found in dependencies")
@@ -48,7 +49,7 @@ def recursive_get_deps(path: str) -> dict:
4849
direct_deps = parsed_mapping["deps"]
4950
to_parse_packages.extend([dep[0] for dep in direct_deps])
5051
for dep in direct_deps:
51-
deps[dep[0]] = Dependency(dep[0], dep[1], '0.0.0', 0)
52+
deps[dep[0]] = Dependency(dep[0], dep[1], "0.0.0", 0)
5253

5354
while len(to_parse_packages) > 0:
5455
package = to_parse_packages.pop()
@@ -58,7 +59,7 @@ def recursive_get_deps(path: str) -> dict:
5859
try:
5960
dep_path = rospack.get_path(package) + "/package.xml"
6061
except rospkg.common.ResourceNotFound:
61-
#print(f"could not find {package}, assuming not a ros package")
62+
# print(f"could not find {package}, assuming not a ros package")
6263
del deps[package]
6364
continue
6465

@@ -67,22 +68,23 @@ def recursive_get_deps(path: str) -> dict:
6768
version_set = parsed_mapping["version"]
6869
if len(version_set) != 1:
6970
print(f"Package {package} should have 1 version, instead its version is {version_set}")
70-
raise Exception #TODO better exception
71+
raise Exception # TODO better exception
7172
# update actual version
72-
deps[package] = Dependency(deps[package].name,
73-
deps[package].req_version,
74-
list(version_set)[0],
75-
deps[package].comparator)
73+
deps[package] = Dependency(
74+
deps[package].name, deps[package].req_version, list(version_set)[0], deps[package].comparator
75+
)
7676

7777
dep_set = parsed_mapping["deps"]
7878
for dep in dep_set:
7979
if dep[0] in parsed_packages:
8080
if dep[0] in deps and deps[dep[0]].req_version != dep[1]:
81-
print(f"inconsistent dependency. According to package {package}, package {dep[0]} should have version {dep[1]}, but another package requires {deps[dep[0]].req_version}")
81+
print(
82+
f"inconsistent dependency. According to package {package}, package {dep[0]} should have version {dep[1]}, but another package requires {deps[dep[0]].req_version}"
83+
)
8284
continue
8385
if dep[0] not in to_parse_packages:
8486
to_parse_packages.append(dep[0])
85-
deps[dep[0]] = Dependency(dep[0], dep[1], 'Problems!', 0)
87+
deps[dep[0]] = Dependency(dep[0], dep[1], "Problems!", 0)
8688
return deps
8789

8890

0 commit comments

Comments
 (0)