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
Add warning when downloading recipes from bintray #9416
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -113,6 +113,11 @@ def _download_recipe(self, layout, ref, output, remotes, remote, recorder): | |||||||||
def _retrieve_from_remote(the_remote): | ||||||||||
output.info("Trying with '%s'..." % the_remote.name) | ||||||||||
# If incomplete, resolve the latest in server | ||||||||||
if "https://conan.bintray.com" in the_remote.url: | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When using Bintray, if you clicked the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I'd say to check fur There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the URL There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a very good reason indeed 😄 |
||||||||||
output.warn("Remote https://conan.bintray.com is deprecated and will be shut down " | ||||||||||
"soon.") | ||||||||||
output.warn("Please use the new 'conancenter' default remote " | ||||||||||
"(https://center.conan.io).") | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For these messages, I really find it useful to provide a copy/paste solution to users:
Suggested change
|
||||||||||
_ref = self._remote_manager.get_recipe(ref, the_remote) | ||||||||||
output.info("Downloaded recipe revision %s" % _ref.revision) | ||||||||||
recorder.recipe_downloaded(ref, the_remote.url) | ||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -447,3 +447,18 @@ def test_create_cli_override(self, client): | |
"test_package/conanfile.py": GenConanfile().with_test("pass")}) | ||
client.run("create . pkg/0.1@ --require-override=zlib/2.0") | ||
assert "zlib/2.0: Already installed" in client.out | ||
|
||
|
||
def test_install_bintray_warning(): | ||
""" | ||
IMPORTANT: This test is actually using https://conan.bintray.com | ||
Warning is only displayed when downloading a recipe from the remote | ||
""" | ||
client = TestClient() | ||
client.run("remote add conan-center https://conan.bintray.com") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tried to avoid using the real bintray remote with a test server using the same URL. However, this lead to modifications to the TestServer class and others in the requester... Anyway, I think it could be useful to have a test that tracks the availability of the remote so we can drop the message once it is no longer available 🤷♂️ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Then, in my opinion, I think we should use a "fake" Bintray URL and check the output: client = TestClient()
fake_bintray_url = "https://myfakebintray.com"
with patch.object(proxy, "BINTRAY_DEPRECATED_URL", return_value=fake_bintray_url):
client.run("remote add conan-center %s" % fake_bintray_url)
# ..... What do you think @danimtb? EDIT: perhaps that |
||
client.run("install zlib/1.2.8@conan/stable -r conan-center") | ||
assert "WARN: Remote https://conan.bintray.com is deprecated and will be shut down " \ | ||
"soon" in client.out | ||
client.run("install zlib/1.2.8@conan/stable -r conan-center -s build_type=Debug") | ||
assert "WARN: Remote https://conan.bintray.com is deprecated and will be shut down " \ | ||
"soon" not in client.out |
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.
I think we should declare that URL as a global variable in this module like:
Then, it should be easier to use it in any test.