Skip to content

Commit 881842c

Browse files
committed
fix: Prevent wrapping long strings in lock file
1 parent 7aecd4b commit 881842c

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

idf_component_manager/utils.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,11 @@
22
# SPDX-License-Identifier: Apache-2.0
33

44
import enum
5-
import sys
5+
import importlib.metadata as importlib_metadata
66
from enum import Enum
77

88
from idf_component_tools.semver import Version
99

10-
if sys.version_info < (3, 8):
11-
import importlib_metadata
12-
else:
13-
import importlib.metadata as importlib_metadata
14-
1510
CLICK_VERSION = Version.coerce(importlib_metadata.version('click'))
1611
CLICK_SUPPORTS_SHOW_DEFAULT = CLICK_VERSION >= Version('7.1.0')
1712

idf_component_tools/lock/manager.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ def __init__(self, path):
2929
self._path = path
3030
self._yaml = YAML(typ='safe')
3131
self._yaml.default_flow_style = False
32+
self._yaml.width = 2048 # Prevent wrapping long strings (hashes...)
3233

3334
def exists(self):
3435
return os.path.isfile(self._path)

idf_component_tools/sources/git.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def download(self, component: 'SolvedComponent', download_path: str) -> t.Option
102102
source_path = os.path.join(str(temp_dir), self.repo_path)
103103
if not os.path.isdir(source_path):
104104
raise FetchingError(
105-
'Directory {} wasn\'t found for the commit id "{}" of the '
105+
'Directory {} was not found for the commit id "{}" of the '
106106
'git repository "{}"'.format(self.repo_path, component.version, self.repo)
107107
)
108108

@@ -147,7 +147,7 @@ def versions(self, name, spec='*', target=None):
147147
version, dependency_description
148148
)
149149
raise FetchingError(
150-
'Directory {} wasn\'t found for the {} of the git repository "{}"'.format(
150+
'Directory {} was not found for the {} of the git repository "{}"'.format(
151151
self.repo_path, dependency_description, self.repo
152152
)
153153
)

0 commit comments

Comments
 (0)