diff --git a/src/conan_check_updates/conan.py b/src/conan_check_updates/conan.py index d1f211b..051dcee 100644 --- a/src/conan_check_updates/conan.py +++ b/src/conan_check_updates/conan.py @@ -173,7 +173,7 @@ def version_str() -> str: _REQUIRES_ATTRIBUTES = ("requires", "build_requires", "tool_requires", "test_requires") -def dequote(s: str) -> str: +def _dequote(s: str) -> str: """If a string has single or double quotes around it, remove them.""" min_length = 2 if (len(s) >= min_length and s[0] == s[-1]) and s.startswith(("'", '"')): @@ -196,7 +196,8 @@ def inspect_requirements_conanfile_py(conanfile: Path) -> List[ConanReference]: res = re.search(r"self\.(?:tool_)*requires\((.*)\)", line) if res: args = res.group(1) - ref = dequote(args) + arg = args.partition(",")[0].strip() # get first argument -> reference string + ref = _dequote(arg) if len(ref) > 0: refs.append(ref) return list(map(ConanReference.parse, refs)) diff --git a/tests/conanfile.py b/tests/conanfile.py index 3d1fc23..58cfd97 100644 --- a/tests/conanfile.py +++ b/tests/conanfile.py @@ -17,6 +17,6 @@ class Example(ConanFile): def requirements(self): self.requires("openssl/3.2.0") self.requires('nanodbc/2.13.0') # fmt:off - self.requires("ms-gsl/3.1.0") + self.requires("ms-gsl/3.1.0", "private") self.tool_requires("cmake/3.27.7") # self.requires("quill/3.6.0")