-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: excepting import error #11957
fix: excepting import error #11957
Conversation
e760ac3
to
abab40c
Compare
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Uilian Ries <uilianries@gmail.com>
This comment has been minimized.
This comment has been minimized.
Bah! new linter rules are flagging error, upgrade docs are here |
This comment has been minimized.
This comment has been minimized.
43e5e20
to
578324e
Compare
Failure in build 7 (
Note: To save resources, CI tries to finish as soon as an error is found. For this reason you might find that not all the references have been launched or not all the configurations for a given reference. Also, take into account that we cannot guarantee the order of execution as it depends on CI workload and workers availability. |
It looks conan.tools has no members that existed before as per Linter. Not sure what to do here. |
@@ -2,12 +2,12 @@ | |||
import os | |||
import re | |||
import functools | |||
from conans import ConanFile, AutoToolsBuildEnvironment, CMake, tools | |||
from conan import ConanFile, AutoToolsBuildEnvironment, CMake, tools |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from conan import ConanFile, AutoToolsBuildEnvironment, CMake, tools | |
from conan import ConanFile | |
from conan.tools.scm import Version | |
from conans import AutoToolsBuildEnvironment, CMake, tools |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -136,12 +136,12 @@ def _is_using_cmake_build(self): | |||
|
|||
@property | |||
def _has_zstd_option(self): | |||
return tools.Version(self.version) >= "7.72.0" | |||
return tools.scm.Version(self.version) >= "7.72.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return tools.scm.Version(self.version) >= "7.72.0" | |
return Version(self.version) >= "7.72.0" |
|
||
@property | ||
def _has_metalink_option(self): | ||
# Support for metalink was removed in version 7.78.0 https://github.com/curl/curl/pull/7176 | ||
return tools.Version(self.version) < "7.78.0" and not self._is_using_cmake_build | ||
return tools.scm.Version(self.version) < "7.78.0" and not self._is_using_cmake_build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return tools.scm.Version(self.version) < "7.78.0" and not self._is_using_cmake_build | |
return Version(self.version) < "7.78.0" and not self._is_using_cmake_build |
@@ -167,7 +167,7 @@ def configure(self): | |||
|
|||
# These options are not used in CMake build yet | |||
if self._is_using_cmake_build: | |||
if tools.Version(self.version) < "7.75.0": | |||
if tools.scm.Version(self.version) < "7.75.0": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if tools.scm.Version(self.version) < "7.75.0": | |
if Version(self.version) < "7.75.0": |
@@ -194,7 +194,7 @@ def validate(self): | |||
raise ConanInvalidConfiguration("schannel only suppported on Windows.") | |||
if self.options.with_ssl == "darwinssl" and not tools.is_apple_os(self.settings.os): | |||
raise ConanInvalidConfiguration("darwinssl only suppported on Apple like OS (Macos, iOS, watchOS or tvOS).") | |||
if self.options.with_ssl == "wolfssl" and self._is_using_cmake_build and tools.Version(self.version) < "7.70.0": | |||
if self.options.with_ssl == "wolfssl" and self._is_using_cmake_build and tools.scm.Version(self.version) < "7.70.0": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if self.options.with_ssl == "wolfssl" and self._is_using_cmake_build and tools.scm.Version(self.version) < "7.70.0": | |
if self.options.with_ssl == "wolfssl" and self._is_using_cmake_build and Version(self.version) < "7.70.0": |
@@ -327,7 +327,7 @@ def _patch_cmake(self): | |||
|
|||
# INTERFACE_LIBRARY (generated by the cmake_find_package generator) targets doesn't have the LOCATION property. | |||
# So skipp the LOCATION check in the CMakeLists.txt | |||
if tools.Version(self.version) >= "7.80.0": | |||
if tools.scm.Version(self.version) >= "7.80.0": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if tools.scm.Version(self.version) >= "7.80.0": | |
if Version(self.version) >= "7.80.0": |
cmake.definitions["CURL_USE_WOLFSSL"] = self.options.with_ssl == "wolfssl" | ||
elif tools.Version(self.version) >= "7.70.0": | ||
elif tools.scm.Version(self.version) >= "7.70.0": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
elif tools.scm.Version(self.version) >= "7.70.0": | |
elif Version(self.version) >= "7.70.0": |
cmake.definitions["CMAKE_USE_WOLFSSL"] = self.options.with_ssl == "wolfssl" | ||
cmake.definitions["USE_NGHTTP2"] = self.options.with_nghttp2 | ||
cmake.definitions["CURL_ZLIB"] = self.options.with_zlib | ||
cmake.definitions["CURL_BROTLI"] = self.options.with_brotli | ||
if self._has_zstd_option: | ||
cmake.definitions["CURL_ZSTD"] = self.options.with_zstd | ||
if tools.Version(self.version) >= "7.81.0": | ||
if tools.scm.Version(self.version) >= "7.81.0": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if tools.scm.Version(self.version) >= "7.81.0": | |
if Version(self.version) >= "7.81.0": |
@@ -560,15 +560,15 @@ def _configure_cmake(self): | |||
cmake.definitions["ENABLE_THREADED_RESOLVER"] = self.options.with_threaded_resolver | |||
cmake.definitions["CURL_DISABLE_PROXY"] = not self.options.with_proxy | |||
cmake.definitions["USE_LIBRTMP"] = self.options.with_librtmp | |||
if tools.Version(self.version) >= "7.75.0": | |||
if tools.scm.Version(self.version) >= "7.75.0": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if tools.scm.Version(self.version) >= "7.75.0": | |
if Version(self.version) >= "7.75.0": |
cmake.definitions["USE_LIBIDN2"] = self.options.with_libidn | ||
cmake.definitions["CURL_DISABLE_RTSP"] = not self.options.with_rtsp | ||
cmake.definitions["CURL_DISABLE_CRYPTO_AUTH"] = not self.options.with_crypto_auth | ||
cmake.definitions["CURL_DISABLE_VERBOSE_STRINGS"] = not self.options.with_verbose_strings | ||
|
||
# Also disables NTLM_WB if set to false | ||
if not self.options.with_ntlm: | ||
if tools.Version(self.version) <= "7.77.0": | ||
if tools.scm.Version(self.version) <= "7.77.0": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if tools.scm.Version(self.version) <= "7.77.0": | |
if Version(self.version) <= "7.77.0": |
@@ -639,7 +639,7 @@ def package_info(self): | |||
if self.options.with_ssl == "schannel": | |||
self.cpp_info.components["curl"].system_libs.append("crypt32") | |||
elif tools.is_apple_os(self.settings.os): | |||
if tools.Version(self.version) >= "7.77.0": | |||
if tools.scm.Version(self.version) >= "7.77.0": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if tools.scm.Version(self.version) >= "7.77.0": | |
if Version(self.version) >= "7.77.0": |
Please do not force push 🙏 GitHub forces us to restart the review which is not fun! |
Please follow eric's suggestions 🙏 |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This pull request has been automatically closed because it has not had recent activity. Thank you for your contributions. |
We get an error
from conan.tools.build import cross_building
ImportError: cannot import name 'cross_building'
and to fix this , we must except the error instead of crashing the program.
Hope it is okay.