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

Remove conan-center default remote #9401

Merged
merged 2 commits into from Aug 11, 2021
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 0 additions & 2 deletions conans/client/cache/remote_registry.py
Expand Up @@ -112,8 +112,6 @@ def defaults(cls):
result = Remotes()
result._remotes[CONAN_CENTER_REMOTE_NAME] = Remote(CONAN_CENTER_REMOTE_NAME,
"https://center.conan.io", True, False)
result._remotes["conan-center"] = Remote("conan-center", "https://conan.bintray.com", True,
False)
return result

def select(self, remote_name):
Expand Down
24 changes: 6 additions & 18 deletions conans/test/integration/configuration/registry_test.py
Expand Up @@ -67,13 +67,11 @@ def test_add_remove_update(self):
registry.add("local", "http://localhost:9300")
self.assertEqual(list(registry.load_remotes().values()),
[("conancenter", "https://center.conan.io", True, False),
("conan-center", "https://conan.bintray.com", True, False),
("local", "http://localhost:9300", True, False)])
# Add
registry.add("new", "new_url", False)
self.assertEqual(list(registry.load_remotes().values()),
[("conancenter", "https://center.conan.io", True, False),
("conan-center", "https://conan.bintray.com", True, False),
("local", "http://localhost:9300", True, False),
("new", "new_url", False, False)])
with self.assertRaises(ConanException):
Expand All @@ -82,7 +80,6 @@ def test_add_remove_update(self):
registry.update("new", "other_url")
self.assertEqual(list(registry.load_remotes().values()),
[("conancenter", "https://center.conan.io", True, False),
("conan-center", "https://conan.bintray.com", True, False),
("local", "http://localhost:9300", True, False),
("new", "other_url", True, False)])
with self.assertRaises(ConanException):
Expand All @@ -91,15 +88,13 @@ def test_add_remove_update(self):
registry.update("new", "other_url", False)
self.assertEqual(list(registry.load_remotes().values()),
[("conancenter", "https://center.conan.io", True, False),
("conan-center", "https://conan.bintray.com", True, False),
("local", "http://localhost:9300", True, False),
("new", "other_url", False, False)])

# Remove
registry.remove("local")
self.assertEqual(list(registry.load_remotes().values()),
[("conancenter", "https://center.conan.io", True, False),
("conan-center", "https://conan.bintray.com", True, False),
("new", "other_url", False, False)])
with self.assertRaises(ConanException):
registry.remove("new2")
Expand Down Expand Up @@ -145,15 +140,13 @@ def test_remote_none(self):
registry.add("foobar", None)
self.assertEqual(list(registry.load_remotes().values()),
[("conancenter", "https://center.conan.io", True, False),
("conan-center", "https://conan.bintray.com", True, False),
("foobar", None, True, False)])
self.assertIn("WARN: The URL is empty. It must contain scheme and hostname.", cache._output)
registry.remove("foobar")

registry.update("conan-center", None)
registry.update("conancenter", None)
self.assertEqual(list(registry.load_remotes().values()),
[("conancenter", "https://center.conan.io", True, False),
("conan-center", None, True, False)])
[("conancenter", None, True, False)])
self.assertIn("WARN: The URL is empty. It must contain scheme and hostname.", cache._output)

def test_enable_disable_remotes(self):
Expand All @@ -166,26 +159,21 @@ def test_enable_disable_remotes(self):
registry.set_disabled_state("local", True)
self.assertEqual(list(registry.load_remotes().all_values()),
[("conancenter", "https://center.conan.io", True, False),
("conan-center", "https://conan.bintray.com", True, False),
("local", "http://localhost:9300", True, True)])

self.assertEqual(list(registry.load_remotes().values()),
[("conancenter", "https://center.conan.io", True, False),
("conan-center", "https://conan.bintray.com", True, False)])
[("conancenter", "https://center.conan.io", True, False)])

registry.set_disabled_state("conan-center", True)
registry.set_disabled_state("conancenter", True)
self.assertEqual(list(registry.load_remotes().all_values()),
[("conancenter", "https://center.conan.io", True, False),
("conan-center", "https://conan.bintray.com", True, True),
[("conancenter", "https://center.conan.io", True, True),
("local", "http://localhost:9300", True, True)])

self.assertEqual(list(registry.load_remotes().values()),
[("conancenter", "https://center.conan.io", True, False)])
self.assertEqual(list(registry.load_remotes().values()), [])

registry.set_disabled_state("*", False)
self.assertEqual(list(registry.load_remotes().values()),
[("conancenter", "https://center.conan.io", True, False),
("conan-center", "https://conan.bintray.com", True, False),
("local", "http://localhost:9300", True, False)])

registry.set_disabled_state("*", True)
Expand Down