本文整理汇总了Python中conan.packager.ConanMultiPackager类的典型用法代码示例。如果您正苦于以下问题:Python ConanMultiPackager类的具体用法?Python ConanMultiPackager怎么用?Python ConanMultiPackager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ConanMultiPackager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testSerialize
def testSerialize(self):
self.packager.add({"os": "Windows", "compiler": "Visual Studio"},
{"option1": "value1", "option2": "value2"})
serial = self.packager.serialize()
self.assertEquals(serial, '{"username": "lasote", "conan_pip_package": null, "args": "--build missing -r conan.io", '\
'"builds": [[{"os": "Windows", "compiler": "Visual Studio"}, '\
'{"option2": "value2", "option1": "value1"}]], "channel": "mychannel"}')
mp = ConanMultiPackager.deserialize(serial, username="lasote")
self.assertEqual(mp.conan_pip_package, None)
self.packager.conan_pip_package = "conan==0.0.1rc7"
serial = self.packager.serialize()
mp = ConanMultiPackager.deserialize(serial, username="lasote")
self.assertEqual(mp.conan_pip_package, "conan==0.0.1rc7")
示例2: run
def run():
"""Reads environment json to create a ConanMultiPackager,
It can run packages with pagination with
CONAN_TOTAL_PAGES and CONAN_CURRENT_PAGE"""
the_json = os.getenv("CONAN_BUILDER_ENCODED", None)
current_page = int(os.getenv("CONAN_CURRENT_PAGE", "1"))
total_pages = int(os.getenv("CONAN_TOTAL_PAGES", "1"))
builder = ConanMultiPackager.deserialize(the_json)
builder.pack(current_page, total_pages)
示例3: main
def main():
"""
Main function.
"""
builder = ConanMultiPackager(username="osechet", channel="testing")
builder.add_common_builds()
filtered_builds = []
for settings, options, env_vars, build_requires in builder.builds:
if settings["compiler"] == "Visual Studio":
if settings["compiler.runtime"] == "MT" or settings["compiler.runtime"] == "MTd":
# Ignore MT runtime
continue
if settings["arch"] != "x86_64":
continue
filtered_builds.append([settings, options, env_vars, build_requires])
builder.builds = filtered_builds
builder.run()
示例4: ConanMultiPackager
from conan.packager import ConanMultiPackager
import copy
if __name__ == "__main__":
builder = ConanMultiPackager()
base = {"os": "Windows", "compiler": "gcc", "compiler.version": "7",
"compiler.exception": "seh", "compiler.libcxx": "libstdc++",
"compiler.threads": "posix"}
for version in ["4.9", "5", "6", "7", "8"]:
tmp = copy.copy(base)
tmp["compiler.version"] = version
for th in ["posix", "win32"]:
tmp2 = copy.copy(tmp)
tmp2["compiler.threads"] = th
for ex in ["seh", "sjlj"]:
tmp3 = copy.copy(tmp2)
tmp3["arch"] = "x86_64"
tmp3["compiler.exception"] = ex
builder.add(tmp3, {}, {}, {})
for ex in ["dwarf2", "sjlj"]:
tmp3 = copy.copy(tmp2)
tmp3["arch"] = "x86"
tmp3["compiler.exception"] = ex
builder.add(tmp3, {}, {}, {})
builder.run()
示例5: ConanMultiPackager
from conan.packager import ConanMultiPackager
import platform
if __name__ == "__main__":
builder = ConanMultiPackager()
# builder.add_common_builds(shared_option_name="SDL2:shared", pure_c=True)
# if platform.system() == "Darwin":
# # Remove static builds in OSx
# static_builds = []
# for build in builder.builds:
# if build[1]["SDL2:shared"]:
# static_builds.append([build[0], {}])
#
# builder.builds = static_builds
#
builder.run() # Will upload just the recipe
示例6: ConanMultiPackager
from conan.packager import ConanMultiPackager
from conans import __version__ as conan_version
from conans.model.version import Version
if __name__ == "__main__":
builder = ConanMultiPackager()
os_name = "os" if conan_version < Version("0.99") else "os_build"
builder.add({os_name: "Windows"}, {}, {}, {})
builder.run()
示例7: AppTest
class AppTest(unittest.TestCase):
def setUp(self):
self.runner = MockRunner()
self.packager = ConanMultiPackager("--build missing -r conan.io",
"lasote", "mychannel",
runner=self.runner)
def testSerialize(self):
self.packager.add({"os": "Windows", "compiler": "Visual Studio"},
{"option1": "value1", "option2": "value2"})
serial = self.packager.serialize()
self.assertEquals(serial, '{"username": "lasote", "conan_pip_package": null, "args": "--build missing -r conan.io", '\
'"builds": [[{"os": "Windows", "compiler": "Visual Studio"}, '\
'{"option2": "value2", "option1": "value1"}]], "channel": "mychannel"}')
mp = ConanMultiPackager.deserialize(serial, username="lasote")
self.assertEqual(mp.conan_pip_package, None)
self.packager.conan_pip_package = "conan==0.0.1rc7"
serial = self.packager.serialize()
mp = ConanMultiPackager.deserialize(serial, username="lasote")
self.assertEqual(mp.conan_pip_package, "conan==0.0.1rc7")
def _add_build(self, number):
self.packager.add({"os": "os%d" % number, "compiler": "os%d" % number},
{"option%d" % number: "value%d" % number,
"option%d" % number: "value%d" % number})
def testPages(self):
for number in xrange(10):
self._add_build(number)
# 10 pages, 1 per build
self.packager.pack(1, 10)
self.assertTrue(self.runner.tests_for([0]))
# 2 pages, 5 per build
self.runner.reset()
self.packager.pack(1, 2)
self.assertTrue(self.runner.tests_for([0, 2, 4, 6, 8]))
self.runner.reset()
self.packager.pack(2, 2)
self.assertTrue(self.runner.tests_for([1, 3, 5, 7, 9]))
# 3 pages, 4 builds in page 1 and 3 in the rest of pages
self.runner.reset()
self.packager.pack(1, 3)
self.assertTrue(self.runner.tests_for([0, 3, 6, 9]))
self.runner.reset()
self.packager.pack(2, 3)
self.assertTrue(self.runner.tests_for([1, 4, 7]))
self.runner.reset()
self.packager.pack(3, 3)
self.assertTrue(self.runner.tests_for([2, 5, 8]))
def testDocker(self):
self.packager.docker_pack(1, 2, ["4.3", "5.2"])
self.assertIn("sudo docker pull lasote/conangcc43", self.runner.calls[0])
self.assertIn("-e CONAN_CURRENT_PAGE=1 -e CONAN_TOTAL_PAGES=2 ", self.runner.calls[1])
self.assertIn('-e CONAN_BUILDER_ENCODED=\'{"username": "lasote"', self.runner.calls[1])
self.assertIn('-e CONAN_USERNAME=lasote -e CONAN_CHANNEL=mychannel', self.runner.calls[1])
示例8: ConanMultiPackager
from conan.packager import ConanMultiPackager
if __name__ == "__main__":
builder = ConanMultiPackager()
builder.add_common_builds(shared_option_name="jansson:shared", pure_c=True)
builder.run()
示例9: ConanMultiPackager
from conan.packager import ConanMultiPackager
import platform
if __name__ == "__main__":
builder = ConanMultiPackager(visual_runtimes=["MT", "MD"])
builder.add_common_builds()
builder.run()
示例10: ConanMultiPackager
from conan.packager import ConanMultiPackager
if __name__ == "__main__":
builder = ConanMultiPackager()
builder.add_common_builds(shared_option_name="cyrus-sasl:shared")
builder.run()
示例11: ConanMultiPackager
from conan.packager import ConanMultiPackager
import platform
if __name__ == "__main__":
builder = ConanMultiPackager()
builder.add_common_builds(pure_c=True, shared_option_name="libcurl:shared")
accepted_builds = []
if platform.system() == "Linux":
for build in builder.builds:
if build[0]["arch"] != "x86":
accepted_builds.append([build[0], build[1]])
builder.builds = accepted_builds
if platform.system() == "Darwin":
for build in builder.builds:
if not build[0]["arch"] == "x86":
accepted_builds.append([build[0], build[1]])
builder.builds = accepted_builds
for compiler in builder.apple_clang_versions:
builder.add({"compiler": "apple-clang", "compiler.version": compiler,
"arch": "x86_64", "build_type": "Release"}, {"libcurl:shared": False,
"libcurl:darwin_ssl": False,
"libcurl:custom_cacert": True})
builder.add({"compiler": "apple-clang", "compiler.version": compiler,
"arch": "x86_64", "build_type": "Debug"}, {"libcurl:shared": False,
"libcurl:darwin_ssl": False,
"libcurl:custom_cacert": True})
builder.run()
示例12: ConanMultiPackager
from conan.packager import ConanMultiPackager
import platform
if __name__ == "__main__":
builder = ConanMultiPackager()
builder.add_common_builds(pure_c=True)
x86_64_builds = []
for build in builder.builds: # Problems installing native GL libs for x86
if not build[0]["arch"] == "x86":
x86_64_builds.append([build[0], build[1]])
builder.builds = x86_64_builds
builder.run()
示例13: ConanMultiPackager
from conan.packager import ConanMultiPackager
if __name__ == "__main__":
builder = ConanMultiPackager(stable_branch_pattern=r"release/")
builder.add_common_builds(shared_option_name="wxWidgets_custom:shared", pure_c=False)
builder.run()
示例14: ConanMultiPackager
from conan.packager import ConanMultiPackager
if __name__ == "__main__":
builder = ConanMultiPackager()
builder.add_common_builds(shared_option_name="BeagleBoneBlackGPIO:shared", pure_c=False)
builder.run()
示例15: ConanMultiPackager
import os
from conan.packager import ConanMultiPackager
from conans import tools
if __name__ == "__main__":
runtimes = ["MD", "MDd"]
for subdir in ["sasl2", "sasldb", "gssapiv2"]:
ref = os.environ.get("CONAN_REFERENCE", "")
if ref:
name, ver = ref.split("/", 1)
os.environ["CONAN_REFERENCE"] = "cyrus-sasl-" + subdir + "/" + ver
with tools.chdir(os.path.join("win32", "conan", subdir)):
builder = ConanMultiPackager(visual_runtimes=runtimes)
builder.add_common_builds(shared_option_name=False, pure_c=True)
builder.run()