Skip to content

Commit

Permalink
Merge branch 'release/0.17.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
lasote committed May 4, 2018
2 parents 759eb87 + 9972d80 commit c02d2f9
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 23 deletions.
2 changes: 1 addition & 1 deletion cpt/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@

__version__ = '0.17.0'
__version__ = '0.17.1'
1 change: 1 addition & 0 deletions cpt/packager.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ def add(self, settings=None, options=None, env_vars=None, build_requires=None, r

def run(self, base_profile_name=None):
env_vars = self.auth_manager.env_vars()
env_vars.update(self.remotes_manager.env_vars())
with tools.environment_append(env_vars):
self.printer.print_message("Running builds...")
if self.ci_manager.skip_builds():
Expand Down
11 changes: 9 additions & 2 deletions cpt/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,22 @@ def run(self):
self.printer.print_profile(tools.load(self._profile_abs_path))

with self.printer.foldable_output("conan_create"):
# TODO: Get uploaded packages with Conan 1.3 from the ret json
self.printer.print_message("Calling 'conan create'")
name, version, user, channel = self._reference
# print_dict
# TODO: Get uploaded packages with Conan 1.3 from the ret json

# FIXME: chdir Can be removed in 1.3, fixed issue about api changing curdir
with tools.chdir(self._abs_folder):
if self._build_policy:
self._build_policy = [self._build_policy]
# https://github.com/conan-io/conan-package-tools/issues/184
with tools.environment_append({"_CONAN_CREATE_COMMAND_": "1"}):
params = {"name": name, "version": version, "user": user,
"channel": channel, "build_modes": self._build_policy,
"profile_name": self._profile_abs_path}
self.printer.print_message("Calling 'conan create'")
self.printer.print_dict(params)

self._conan_api.create(".", name=name, version=version,
user=user, channel=channel,
build_modes=self._build_policy,
Expand Down
4 changes: 2 additions & 2 deletions cpt/test/integration/basic_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def build(self):
"""
self.save_conanfile(conanfile)
self.packager = ConanMultiPackager("--build missing -r conan.io",
self.packager = ConanMultiPackager(["--build missing", "-r conan.io"],
"lasote", "mychannel",
visual_versions=[15],
archs=["x86"],
Expand All @@ -71,7 +71,7 @@ def build(self):
"""
self.save_conanfile(conanfile)
self.packager = ConanMultiPackager("--build missing -r conan.io",
self.packager = ConanMultiPackager(["--build missing", "-r conan.io"],
"lasote", "mychannel",
visual_versions=[15],
archs=["x86"],
Expand Down
6 changes: 3 additions & 3 deletions cpt/test/integration/docker_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class Pkg(ConanFile):
"CONAN_USERNAME": "lasote",
"CONAN_UPLOAD": CONAN_UPLOAD_URL,
"CONAN_PASSWORD": CONAN_UPLOAD_PASSWORD}):
self.packager = ConanMultiPackager("--build missing -r conan.io",
self.packager = ConanMultiPackager(["--build missing", "-r conan.io"],
channel="mychannel",
gcc_versions=["6"],
archs=["x86", "x86_64"],
Expand Down Expand Up @@ -65,15 +65,15 @@ class Pkg(ConanFile):
"CONAN_PIP_PACKAGE": pip,
"CONAN_LOGIN_USERNAME": CONAN_LOGIN_UPLOAD,
"CONAN_USERNAME": "lasote",
"CONAN_UPLOAD": CONAN_UPLOAD_URL,
"CONAN_PASSWORD": CONAN_UPLOAD_PASSWORD,
"CONAN_UPLOAD_ONLY_WHEN_STABLE": "1"}):
self.packager = ConanMultiPackager("--build missing -r conan.io",
self.packager = ConanMultiPackager(["--build missing", "-r conan.io"],
channel="mychannel",
gcc_versions=["6"],
archs=["x86", "x86_64"],
build_types=["Release"],
reference=unique_ref,
upload=CONAN_UPLOAD_URL,
ci_manager=ci_manager)
self.packager.add_common_builds()
self.packager.run()
Expand Down
30 changes: 15 additions & 15 deletions cpt/test/unit/packager_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def setUp(self):
self.runner = MockRunner()
self.conan_api = MockConanAPI()
self.ci_manager = MockCIManager()
self.packager = ConanMultiPackager("--build missing -r conan.io",
self.packager = ConanMultiPackager(["--build missing", "-r conan.io"],
"lasote", "mychannel",
runner=self.runner,
conan_api=self.conan_api,
Expand Down Expand Up @@ -103,7 +103,7 @@ def test_pages(self):
def test_deprecation_gcc(self):

with self.assertRaisesRegexp(Exception, "DEPRECATED GCC MINOR VERSIONS!"):
ConanMultiPackager("--build missing -r conan.io",
ConanMultiPackager(["--build missing", "-r conan.io"],
"lasote", "mychannel",
runner=self.runner,
conan_api=self.conan_api,
Expand All @@ -113,7 +113,7 @@ def test_deprecation_gcc(self):
ci_manager=self.ci_manager)

def test_32bits_images(self):
packager = ConanMultiPackager("--build missing -r conan.io",
packager = ConanMultiPackager(["--build missing", "-r conan.io"],
"lasote", "mychannel",
runner=self.runner,
use_docker=True,
Expand All @@ -126,7 +126,7 @@ def test_32bits_images(self):
self.assertIn("docker pull lasote/conangcc6-x86", self.runner.calls[0])

self.runner.reset()
packager = ConanMultiPackager("--build missing -r conan.io",
packager = ConanMultiPackager(["--build missing", "-r conan.io"],
"lasote", "mychannel",
runner=self.runner,
conan_api=self.conan_api,
Expand All @@ -141,7 +141,7 @@ def test_32bits_images(self):

self.runner.reset()
with tools.environment_append({"CONAN_DOCKER_32_IMAGES": "1"}):
packager = ConanMultiPackager("--build missing -r conan.io",
packager = ConanMultiPackager(["--build missing", "-r conan.io"],
"lasote", "mychannel",
runner=self.runner,
conan_api=self.conan_api,
Expand All @@ -155,7 +155,7 @@ def test_32bits_images(self):

self.runner.reset()
# Test the opossite
packager = ConanMultiPackager("--build missing -r conan.io",
packager = ConanMultiPackager(["--build missing", "-r conan.io"],
"lasote", "mychannel",
runner=self.runner,
conan_api=self.conan_api,
Expand All @@ -169,7 +169,7 @@ def test_32bits_images(self):
self.assertIn("docker pull lasote/conangcc6", self.runner.calls[0])

def test_docker_gcc(self):
self.packager = ConanMultiPackager("--build missing -r conan.io",
self.packager = ConanMultiPackager(["--build missing", "-r conan.io"],
"lasote", "mychannel",
runner=self.runner,
conan_api=self.conan_api,
Expand All @@ -194,7 +194,7 @@ def test_docker_gcc(self):
for the_bool in ["True", "False"]:
self.runner.reset()
with tools.environment_append({"CONAN_DOCKER_USE_SUDO": the_bool}):
self.packager = ConanMultiPackager("--build missing -r conan.io",
self.packager = ConanMultiPackager(["--build missing", "-r conan.io"],
"lasote", "mychannel",
runner=self.runner,
conan_api=self.conan_api,
Expand All @@ -211,7 +211,7 @@ def test_docker_gcc(self):
self.assertIn("docker run", self.runner.calls[-1])
self.runner.reset()
with tools.environment_append({"CONAN_PIP_USE_SUDO": the_bool}):
self.packager = ConanMultiPackager("--build missing -r conan.io",
self.packager = ConanMultiPackager(["--build missing", "-r conan.io"],
"lasote", "mychannel",
runner=self.runner,
conan_api=self.conan_api,
Expand All @@ -228,7 +228,7 @@ def test_docker_gcc(self):
self.assertIn("pip", self.runner.calls[1])

def test_docker_clang(self):
self.packager = ConanMultiPackager("--build missing -r conan.io",
self.packager = ConanMultiPackager(["--build missing", "-r conan.io"],
"lasote", "mychannel",
runner=self.runner,
conan_api=self.conan_api,
Expand All @@ -250,7 +250,7 @@ def test_docker_clang(self):
self.assertIn('os=os3', self.runner.calls[5])

def test_docker_gcc_and_clang(self):
self.packager = ConanMultiPackager("--build missing -r conan.io",
self.packager = ConanMultiPackager(["--build missing", "-r conan.io"],
"lasote", "mychannel",
runner=self.runner,
conan_api=self.conan_api,
Expand Down Expand Up @@ -281,15 +281,15 @@ def test_docker_gcc_and_clang(self):
self.assertIn('os=os6', self.runner.calls[21])

def test_upload_false(self):
packager = ConanMultiPackager("--build missing -r conan.io", "lasote", "mychannel",
packager = ConanMultiPackager(["--build missing", "-r conan.io"], "lasote", "mychannel",
upload=False, reference="zlib/1.2.11",
ci_manager=self.ci_manager)
self.assertFalse(packager._upload_enabled())

def test_docker_env_propagated(self):
# test env
with tools.environment_append({"CONAN_FAKE_VAR": "32"}):
self.packager = ConanMultiPackager("--build missing -r conan.io",
self.packager = ConanMultiPackager(["--build missing", "-r conan.io"],
"lasote", "mychannel",
runner=self.runner,
conan_api=self.conan_api,
Expand All @@ -303,7 +303,7 @@ def test_docker_env_propagated(self):
self.assertIn('-e CONAN_FAKE_VAR="32"', self.runner.calls[-1])

def test_docker_invalid(self):
self.packager = ConanMultiPackager("--build missing -r conan.io",
self.packager = ConanMultiPackager(["--build missing", "-r conan.io"],
"lasote", "mychannel",
runner=self.runner,
conan_api=self.conan_api,
Expand All @@ -317,7 +317,7 @@ def test_docker_invalid(self):
self.assertRaises(Exception, self.packager.run_builds)

def test_assign_builds_retrocompatibility(self):
self.packager = ConanMultiPackager("--build missing -r conan.io",
self.packager = ConanMultiPackager(["--build missing", "-r conan.io"],
"lasote", "mychannel",
runner=self.runner,
conan_api=self.conan_api,
Expand Down

0 comments on commit c02d2f9

Please sign in to comment.