Skip to content

Commit

Permalink
Merge pull request #18 from bincrafters/hotfix/remotes
Browse files Browse the repository at this point in the history
#650 Include Bincrafters as remote repo
  • Loading branch information
SSE4 authored Feb 19, 2019
2 parents 44a29e3 + dacab49 commit e50bb7f
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bincrafters/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.17.8'
__version__ = '0.17.9'
4 changes: 4 additions & 0 deletions bincrafters/build_paths.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

BINCRAFTERS_REPO_URL = "https://api.bintray.com/conan/bincrafters/public-conan"
7 changes: 7 additions & 0 deletions bincrafters/build_shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from cpt.packager import ConanMultiPackager
from cpt.tools import split_colon_env
from cpt.remotes import RemotesManager
from bincrafters.build_paths import BINCRAFTERS_REPO_URL


def get_bool_from_env(var_name, default="1"):
Expand Down Expand Up @@ -126,6 +127,11 @@ def get_conan_remotes(username):
bincrafters_user = "bincrafters"
if username != bincrafters_user:
remotes.append(get_conan_upload(bincrafters_user))

# Force Bincrafters repo on remotes
if BINCRAFTERS_REPO_URL not in remotes:
remotes.append(BINCRAFTERS_REPO_URL)

return remotes


Expand All @@ -143,6 +149,7 @@ def get_archs():
return ["x86_64"]
return split_colon_env("CONAN_ARCHS") if archs else None


def get_builder(build_policy=None):
name = get_name_from_recipe()
username, channel, version, login_username = get_conan_vars()
Expand Down
10 changes: 10 additions & 0 deletions tests/test_package_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,3 +232,13 @@ def test_format_mixed_remotes(set_mixed_remote_address):
assert "remote1" == remote.name
assert "https://api.bintray.com/conan/qux/baz" == remote.url
assert True == remote.use_ssl

def test_default_remote_address(set_upload_address):
builder = build_template_default.get_builder()
assert 2 == len(builder.remotes_manager._remotes)
remote = builder.remotes_manager._remotes[0]
assert "remotefoo" == remote.name
assert "https://api.bintray.com/conan/foo/bar" == remote.url
remote = builder.remotes_manager._remotes[1]
assert "remote1" == remote.name
assert "https://api.bintray.com/conan/bincrafters/public-conan" == remote.url

0 comments on commit e50bb7f

Please sign in to comment.