diff --git a/hooks/yaml_linter.py b/hooks/yaml_linter.py index efca1e43..bc31a40c 100644 --- a/hooks/yaml_linter.py +++ b/hooks/yaml_linter.py @@ -5,8 +5,6 @@ import subprocess from conans.errors import ConanException -from conans.tools import logger - CONAN_HOOK_YAMLLINT_WERR = "CONAN_YAMLLINT_WERR" diff --git a/tests/test_hooks/conan-center/test_packaging_static_shared.py b/tests/test_hooks/conan-center/test_packaging_static_shared.py index bebf9a39..5503367a 100644 --- a/tests/test_hooks/conan-center/test_packaging_static_shared.py +++ b/tests/test_hooks/conan-center/test_packaging_static_shared.py @@ -68,6 +68,27 @@ def package_info(self): self.cpp_info.libs = ["foo"] """) + conanfile_test_shared_windows = textwrap.dedent("""\ + from conan import ConanFile + import os + + class AConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + options = {"shared": [True, False]} + default_options = {"shared": False} + + def package(self): + libdir = os.path.join(self.package_folder, "lib") + bindir = os.path.join(self.package_folder, "bin") + os.makedirs(libdir) + os.makedirs(bindir) + # Issue related: https://github.com/conan-io/hooks/issues/528 + open(os.path.join(libdir, "libfoo.dll.lib"), "w") + open(os.path.join(bindir, "libfoo.dll"), "w") + + def package_info(self): + self.cpp_info.libs = ["foo"] + """) def _get_environ(self, **kwargs): kwargs = super(TestPackagingStaticSharedLibraries, self)._get_environ(**kwargs) kwargs.update({ @@ -106,3 +127,10 @@ def test_either_shared_or_static(self, shared, hook_ok): self.assertIn("[EITHER STATIC OR SHARED OF EACH LIB (KB-H076)] OK", output) else: self.assertIn("ERROR: [EITHER STATIC OR SHARED OF EACH LIB (KB-H076)] Package contains both shared and static flavors of these libraries: libfoo, libfoobar", output) + + def test_shared_windows(self): + tools.save("conanfile.py", content=self.conanfile_test_shared_windows) + output = self.conan([ + "create", ".", "name/version@user/test", "-o", "shared=True"]) + self.assertNotIn("[LIBRARY DOES NOT EXIST (KB-H054)] Component name::name library 'foo' is listed in the " + "recipe, but not found installed at self.cpp_info.libdirs", output) diff --git a/tests/utils/test_cases/conan_client_v2.py b/tests/utils/test_cases/conan_client_v2.py index 500ec176..1ec39599 100644 --- a/tests/utils/test_cases/conan_client_v2.py +++ b/tests/utils/test_cases/conan_client_v2.py @@ -6,7 +6,8 @@ import uuid import subprocess -from conan.cli.exit_codes import SUCCESS +from conans.cli.exit_codes import SUCCESS + from tests.utils.environ_vars import context_env