Skip to content
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

Merged
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions conans/client/graph/proxy.py
Expand Up @@ -13,6 +13,9 @@
from conans.util.tracer import log_recipe_got_from_local_cache


DEPRECATED_CONAN_CENTER_BINTRAY_URL = "https://conan.bintray.com"
danimtb marked this conversation as resolved.
Show resolved Hide resolved


class ConanProxy(object):
def __init__(self, cache, output, remote_manager):
# collaborators
Expand Down Expand Up @@ -113,6 +116,12 @@ 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 the_remote.url.startswith(DEPRECATED_CONAN_CENTER_BINTRAY_URL):
output.warn("Remote https://conan.bintray.com is deprecated and will be shut down "
"soon.")
output.warn("Please use the new 'conancenter' default remote.")
output.warn("Add it to your remotes with: conan remote add -i 0 conancenter "
"https://center.conan.io")
_ref = self._remote_manager.get_recipe(ref, the_remote)
output.info("Downloaded recipe revision %s" % _ref.revision)
recorder.recipe_downloaded(ref, the_remote.url)
Expand Down
18 changes: 18 additions & 0 deletions conans/test/integration/command/install/install_test.py
Expand Up @@ -447,3 +447,21 @@ 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():
server = TestServer(complete_urls=True)
from conans.client.graph import proxy
proxy.DEPRECATED_CONAN_CENTER_BINTRAY_URL = server.fake_url # Mocking!
client = TestClient(servers={"conan-center": server},
users={"conan-center": [("lasote", "mypass")]})
client.save({"conanfile.py": GenConanfile()})
client.run("create . zlib/1.0@lasote/testing")
client.run("upload zlib/1.0@lasote/testing --all -r conan-center")
client.run("remove * -f")
client.run("install zlib/1.0@lasote/testing -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.0@lasote/testing -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