diff --git a/.ci/appveyor/install.bat b/.ci/appveyor/install.bat deleted file mode 100644 index 0a54b274..00000000 --- a/.ci/appveyor/install.bat +++ /dev/null @@ -1,5 +0,0 @@ -SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH% -SET PYTHONPATH=%PYTHONPATH%;%CD% -SET CONAN_TEST_SUITE=1 -%PYTHON%/Scripts/pip.exe install -r cpt/requirements_test.txt -%PYTHON%/Scripts/pip.exe install -r cpt/requirements.txt diff --git a/.ci/appveyor/test.bat b/.ci/appveyor/test.bat deleted file mode 100644 index ecaaf2b3..00000000 --- a/.ci/appveyor/test.bat +++ /dev/null @@ -1,3 +0,0 @@ -conan user -mkdir %HOMEPATH%/.conan/data -nosetests cpt.test --nocapture diff --git a/.github/deploy/release_changelog.py b/.github/deploy/release_changelog.py new file mode 100644 index 00000000..18695add --- /dev/null +++ b/.github/deploy/release_changelog.py @@ -0,0 +1,247 @@ +import argparse +import os +import re +from datetime import date + +from github import Github + + +GH_TOKEN = os.getenv("GH_TOKEN") +GH_COMMIT = os.getenv("GITHUB_SHA") +REPOSITORY = os.getenv("GITHUB_REPOSITORY") or "conan-io/conan-package-tools" +TAG = "changelog:" +DOCS_TAG = "docs:" + + +class GHReleaser(object): + def __init__(self, gh_token, repository): + tmp = Github(gh_token) + self._repo = tmp.get_repo(repository) + + def release(self, version, changelog, commit_hash, files=None): + d = date.today() + d_str = d.strftime("%d-%b-%Y") + release_name = "%s (%s)" % (version, d_str) + release = self._repo.create_git_release(version, + name=release_name, + message=changelog, + target_commitish=commit_hash, + draft=True) + if files: + for the_file in files: + release.upload_asset(the_file) + + release.update_release(name=release_name, + message=changelog, + draft=False) + + +def get_changelog_markdown(version, repository, gh_token, with_docs=True): + changelogs, errors = get_changelogs(repository, version, gh_token, with_docs=with_docs) + if errors: + raise Exception("Check the errors in the changelog and try again") + + markdown = get_markdown(changelogs) + return markdown + + +def get_changelog_rst(version, repository, gh_token, docs=True): + changelogs, errors = get_changelogs(repository, version, gh_token, with_docs=docs) + if errors: + raise Exception("Check the errors in the changelog and try again") + + rst = get_rst(changelogs) + return rst + + +def get_rst(changelogs): + c = order_changelogs(changelogs) + rst = format_to_rst(c) + return rst + + +def format_to_rst(changelogs): + lines = [] + for x in changelogs: + if x[2]: # With docs + lines.append("- %s `#%s <%s>`_ . Docs `here <%s>`__" % (x[0], + x[1].split("/")[-1], + x[1], + x[2])) + else: + lines.append("- %s `#%s <%s>`_" % (x[0], x[1].split("/")[-1], x[1])) + tmp = "\n".join(lines) + + commands = ["install", "config", "get", "info", "search", "new", "create", "upload", "export", + "export-pkg", "test", "source", "build", "package", "profile", "remote", "user", + "imports", "copy", "remove", "alias", "download", "help", "inspect"] + + # Format detected commands with :command: + for cmd in commands: + regex = r"`{1,2}(conan %s)`{1,2}" % cmd + tmp = re.sub(regex, r":command:`\1`", tmp) + return tmp + "\n" + + +def print_step(message): + print("\n\n*******************************************************************") + print("* %s" % message) + print("*******************************************************************\n") + + +def get_changelogs(repo_name, milestone, gh_token, with_docs=True): + err = False + changelogs = [] + + g = Github(gh_token) + repo = g.get_repo(repo_name) + + print("Searching for {} milestone".format(milestone)) + tmp = milestone.split(".") + if len(tmp) == 3 and tmp[2] == "0": + milestone_alternative = ".".join(tmp[0:2]) + else: + milestone_alternative = milestone + + milestone = milestone_by_name(repo, (milestone, milestone_alternative)) + if not milestone: + print("ERROR: Milestone not found!") + exit(1) + + print("Reading issues from GH api...") + issues = repo.get_issues(milestone=milestone, state="all") + print("done!") + + for issue in issues: + if issue.pull_request: + body = issue.body + if TAG in body.lower(): + tmp = _get_tag_text(TAG, body) + if with_docs: + if DOCS_TAG not in body.lower(): + print("WARNING: Empty DOCS for changelog at %s" % issue.html_url) + err = True + continue + docs_link = _get_tag_text(DOCS_TAG, body) + else: + docs_link = None + if docs_link: + if not docs_link[0].strip().startswith("https://github.com/conan-io/docs/") or docs_link[0].strip().endswith("XXX"): + print("WARNING: Invalid DOCS tag for changelog at %s (%s)" % (issue.html_url, docs_link)) + err = True + continue + else: + pr_number = docs_link[0].rsplit('/', 1)[1] + docs_repo = g.get_repo("conan-io/docs") + docs_pr = docs_repo.get_pull(int(pr_number)) + if not docs_pr.merged: + print("WARNING: Docs PR #{} is not merged.".format(pr_number)) + err = True + continue + changelogs.extend([(cl, issue.html_url, docs_link[0]) for cl in tmp]) + else: + changelogs.extend([(cl, issue.html_url, None) for cl in tmp]) + else: + print("WARNING: Empty changelog at %s" % issue.html_url) + err = True + continue + return changelogs, err + + +def milestone_by_name(repo, milestone_names): + milestones = list(repo.get_milestones(state="all")) + for milestone in milestones: + if milestone.title in milestone_names: + return milestone + return None + + +def _get_tag_text(tag, body): + ret = [] + pos = body.lower().find(tag) + while pos != -1: + cl = body[pos + len(tag):].splitlines()[0] + cl = cl.strip().strip("-") + # Just in case "omitted" or "omit" appears in the explanation + if cl and ("omit" not in cl.lower() or len(cl) > 20): + ret.append(cl) + body = body[pos + len(tag):] + pos = body.lower().find(tag) + return ret + + +def get_markdown(changelogs): + c = order_changelogs(changelogs) + markdown = format_to_gh(c) + return markdown + + +def order_changelogs(changelogs): + def weight(element, raising=True): + global error + el = element[0] + if el.lower().startswith("feature:"): + return 0 + elif el.lower().startswith("bugfix:"): + return 2 + elif el.lower().startswith("fix:"): + return 1 + else: + msg = "WARNING: Invalid tag '%s' at %s" % (el.split(" ")[0], element[1]) + if raising: + raise Exception("Check the errors and try again") + else: + print(msg) + # To print the errors + sorted(changelogs, key=lambda x: weight(x, raising=False)) + # To raise when errored + return sorted(changelogs, key=lambda x: weight(x)) + + +def format_to_gh(changelogs): + lines = [] + for x in changelogs: + if x[2]: # With docs + lines.append("- %s (%s). Docs: [:page_with_curl:](%s)" % (x[0], x[1], x[2])) + else: + lines.append("- %s (%s)" % (x[0], x[1])) + return "\n".join(lines) + + +if __name__ == "__main__": + parser = argparse.ArgumentParser(description='Launch configuration according ' + 'to the environment') + parser.add_argument('--release-version', '-rv', help='CPT release version e.g: 1.8') + parser.add_argument('--dry-run', '-d', help='Do not commit changes', action="store_true") + args = parser.parse_args() + + release_version = args.release_version + if release_version is None: + github_ref = os.getenv("GITHUB_REF") + if not github_ref: + print("ERROR: Only Github Action supported.") + exit(1) + match = re.search(r"refs/tags/(.*)", github_ref) + if not match: + print("ERROR: Invalid branch or tag.") + exit(1) + + release_version = match.group(1) + + # Generate changelog, verify all is ok + print_step("Getting changelog markdown from '{}'".format(REPOSITORY, release_version)) + changelog = get_changelog_markdown(release_version, REPOSITORY, GH_TOKEN, with_docs=False) + if not changelog: + print("ERROR! The changelog is empty, verify the milestone name: %s" % release_version) + exit(1) + + print(changelog) + print("-----------------------------------") + + if args.dry_run: + print_step("DRY RUN - SKIP Release to GitHub") + else: + print_step("Releasing to GitHub...") + releaser = GHReleaser(GH_TOKEN, REPOSITORY) + releaser.release(release_version, changelog, GH_COMMIT) + print_step("** RELEASED **") diff --git a/.github/workflows/conan_package_tools.yml b/.github/workflows/conan_package_tools.yml new file mode 100644 index 00000000..98feff36 --- /dev/null +++ b/.github/workflows/conan_package_tools.yml @@ -0,0 +1,175 @@ +on: [push, pull_request] + +jobs: + conan_stable_windows: + runs-on: windows-latest + strategy: + fail-fast: false + matrix: + config: + - { name: "Conan Stable - Python 2.7", python: 2.7, toxenv: "py27-conan-latest", pyver: "py27" } + - { name: "Conan Stable - Python 3.7", python: 3.7, toxenv: "py37-conan-latest", pyver: "py37" } + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.config.python }} + - name: Setup MSBuild.exe + uses: microsoft/setup-msbuild@v1.0.2 + with: + vs-version: 16.9 + - name: Install dependencies + env: + PYVER: ${{ matrix.config.pyver }} + run: | + .github/workflows/install.bat + - name: ${{ matrix.config.name }} + env: + CONAN_VISUAL_VERSIONS: 16 + PYVER: ${{ matrix.config.pyver }} + run: | + .github/workflows/run.bat + + conan_stable_linux: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + config: + - { name: "Conan Stable - Python 2.7", python: 2.7, toxenv: "py27-conan-latest", pyver: "py27" } + - { name: "Conan Stable - Python 3.7", python: 3.7, toxenv: "py37-conan-latest", pyver: "py37" } + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.config.python }} + - name: Install dependencies + env: + PYVER: ${{ matrix.config.pyver }} + run: | + chmod +x .github/workflows/install.sh + .github/workflows/install.sh + - name: ${{ matrix.config.name }} + env: + TOXENV: ${{ matrix.config.toxenv }} + PYVER: ${{ matrix.config.pyver }} + run: | + chmod +x .github/workflows/run.sh + .github/workflows/run.sh + - name: Codecov + run: | + bash <(curl -s https://codecov.io/bash) + + conan_stable_osx: + runs-on: macos-latest + strategy: + fail-fast: false + matrix: + config: + - { name: "Conan Stable - Python 2.7", python: 2.7, toxenv: "py27-conan-latest", pyver: "py27" } + - { name: "Conan Stable - Python 3.7", python: 3.7, toxenv: "py37-conan-latest", pyver: "py37" } + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.config.python }} + - name: Install dependencies + env: + PYVER: ${{ matrix.config.pyver }} + run: | + chmod +x .github/workflows/install.sh + .github/workflows/install.sh + - name: ${{ matrix.config.name }} + env: + TOXENV: ${{ matrix.config.toxenv }} + PYVER: ${{ matrix.config.pyver }} + run: | + chmod +x .github/workflows/run.sh + .github/workflows/run.sh + + conan_develop_linux: + if: github.ref != 'refs/head/master' && !startsWith(github.ref, 'refs/heads/release/') && !startsWith(github.ref, 'refs/tags') + runs-on: ubuntu-latest + continue-on-error: True + strategy: + fail-fast: false + matrix: + config: + - { name: "Conan Develop - Python 2.7", python: 2.7, toxenv: "py27-conan-dev", pyver: "py27" } + - { name: "Conan Develop - Python 3.7", python: 3.7, toxenv: "py37-conan-dev", pyver: "py37" } + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.config.python }} + - name: Install dependencies + env: + PYVER: ${{ matrix.config.pyver }} + run: | + export + env + chmod +x .github/workflows/install.sh + .github/workflows/install.sh + - name: ${{ matrix.config.name }} + env: + TOXENV: ${{ matrix.config.toxenv }} + PYVER: ${{ matrix.config.pyver }} + run: | + chmod +x .github/workflows/run.sh + .github/workflows/run.sh + + conan_develop_osx: + if: github.ref != 'refs/head/master' && !startsWith(github.ref, 'refs/heads/release/') && !startsWith(github.ref, 'refs/tags') + runs-on: macos-latest + continue-on-error: True + strategy: + fail-fast: false + matrix: + config: + - { name: "Conan Develop - Python 2.7", python: 2.7, toxenv: "py27-conan-dev", pyver: "py27" } + - { name: "Conan Develop - Python 3.7", python: 3.7, toxenv: "py37-conan-dev", pyver: "py37" } + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.config.python }} + - name: Install dependencies + env: + PYVER: ${{ matrix.config.pyver }} + run: | + export + env + chmod +x .github/workflows/install.sh + .github/workflows/install.sh + - name: ${{ matrix.config.name }} + env: + TOXENV: ${{ matrix.config.toxenv }} + PYVER: ${{ matrix.config.pyver }} + run: | + chmod +x .github/workflows/run.sh + .github/workflows/run.sh + + deploy_release: + if: startsWith(github.ref, 'refs/tags') + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.7 + - name: Install dependencies + run: pip install pygithub + - name: Generate changelog + run: python .github/deploy/release_changelog.py + - name: Generate Dist/ + run: python setup.py sdist + - uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/.github/workflows/install.bat b/.github/workflows/install.bat new file mode 100644 index 00000000..d1511737 --- /dev/null +++ b/.github/workflows/install.bat @@ -0,0 +1,3 @@ +SET CONAN_TEST_SUITE=1 +pip install -r cpt/requirements_test.txt +pip install -r cpt/requirements.txt diff --git a/.ci/travis/install.sh b/.github/workflows/install.sh similarity index 100% rename from .ci/travis/install.sh rename to .github/workflows/install.sh diff --git a/.ci/travis/requirements_travis.txt b/.github/workflows/requirements_travis.txt similarity index 100% rename from .ci/travis/requirements_travis.txt rename to .github/workflows/requirements_travis.txt diff --git a/.github/workflows/run.bat b/.github/workflows/run.bat new file mode 100644 index 00000000..e24ee0e7 --- /dev/null +++ b/.github/workflows/run.bat @@ -0,0 +1,4 @@ +conan user +mkdir %USERPROFILE%/.conan/data +set USE_UNSUPPORTED_CONAN_WITH_PYTHON_2=1 +nosetests -v cpt.test --nocapture diff --git a/.ci/travis/run.sh b/.github/workflows/run.sh similarity index 96% rename from .ci/travis/run.sh rename to .github/workflows/run.sh index 76a1c8e1..dcbcfc01 100755 --- a/.ci/travis/run.sh +++ b/.github/workflows/run.sh @@ -12,4 +12,4 @@ fi conan user mkdir ~/.conan/data -tox +tox -v diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 5b0501b7..00000000 --- a/.travis.yml +++ /dev/null @@ -1,43 +0,0 @@ -sudo: false -language: python -dist: trusty - -jobs: - fast_finish: true - include: - - - stage: Conan Development - Linux - if: branch != master AND branch !~ /release*/ - python: 2.7 - env: TOXENV=py27-conan-dev - - python: 3.7 - if: branch != master AND branch !~ /release*/ - env: TOXENV=py37-conan-dev - dist: xenial - - - stage: Conan Latest - Linux - python: 2.7 - env: TOXENV=py27-conan-latest - - python: 3.7 - env: TOXENV=py37-conan-latest - dist: xenial - - - stage: Conan Latest - Macos - language: generic - os: osx - osx_image: xcode10.3 - env: PYVER=py27 TOXENV=py27-conan-latest - - language: generic - os: osx - osx_image: xcode10.3 - env: PYVER=py37 TOXENV=py37-conan-latest - - -install: - - .ci/travis/install.sh - -script: - - .ci/travis/run.sh - -after_success: - - bash <(curl -s https://codecov.io/bash) diff --git a/README.md b/README.md index 69f1b8c9..e6c2485a 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ -[![Build Status Travis](https://travis-ci.org/conan-io/conan-package-tools.svg?branch=master)](https://travis-ci.org/conan-io/conan-package-tools) -[![Build status Appveyor](https://ci.appveyor.com/api/projects/status/github/conan-io/conan-package-tools?svg=true)](https://ci.appveyor.com/project/ConanCIintegration/conan-package-tools) +[![.github/workflows/conan_package_tools.yml](https://github.com/conan-io/conan-package-tools/actions/workflows/conan_package_tools.yml/badge.svg)](https://github.com/conan-io/conan-package-tools/actions/workflows/conan_package_tools.yml) [![codecov](https://codecov.io/gh/conan-io/conan-package-tools/branch/master/graph/badge.svg)](https://codecov.io/gh/conan-io/conan-package-tools) ![PyPI - Downloads](https://img.shields.io/pypi/dm/conan-package-tools.svg?style=plastic) diff --git a/cpt/builds_generator.py b/cpt/builds_generator.py index 6781a471..e707d340 100644 --- a/cpt/builds_generator.py +++ b/cpt/builds_generator.py @@ -6,11 +6,11 @@ from conans.model.version import Version from cpt.tools import split_colon_env, transform_list_options_to_dict -default_gcc_versions = ["4.9", "5", "6", "7", "8", "9"] -default_clang_versions = ["3.8", "3.9", "4.0", "5.0", "6.0", "7.0", "8", "9"] -default_visual_versions = ["14", "15"] +default_gcc_versions = ["4.9", "5", "6", "7", "8", "9", "10"] +default_clang_versions = ["3.8", "3.9", "4.0", "5.0", "6.0", "7.0", "8", "9", "10", "11"] +default_visual_versions = ["14", "15", "16"] default_visual_runtimes = ["MT", "MD", "MTd", "MDd"] -default_apple_clang_versions = ["9.0", "9.1", "10.0", "11.0"] +default_apple_clang_versions = ["9.0", "9.1", "10.0", "11.0", "12.0"] default_archs = ["x86", "x86_64"] default_build_types = ["Release", "Debug"] default_cppstds = [None] diff --git a/cpt/requirements_deploy.txt b/cpt/requirements_deploy.txt new file mode 100644 index 00000000..8c5188ea --- /dev/null +++ b/cpt/requirements_deploy.txt @@ -0,0 +1,2 @@ +pygithub +twine \ No newline at end of file diff --git a/cpt/test/integration/basic_test.py b/cpt/test/integration/basic_test.py index 390757b6..2c070f20 100644 --- a/cpt/test/integration/basic_test.py +++ b/cpt/test/integration/basic_test.py @@ -39,7 +39,7 @@ def build(self): self.save_conanfile(conanfile) self.packager = ConanMultiPackager(username="lasote", channel="mychannel", - visual_versions=[15], + visual_versions=["16"], archs=["x86"], build_types=["Release"], visual_runtimes=["MD"], @@ -61,7 +61,7 @@ def build(self): self.save_conanfile(conanfile) self.packager = ConanMultiPackager(username="lasote", channel="mychannel", - visual_versions=[15], + visual_versions=["16"], archs=["x86"], build_types=["Release"], visual_runtimes=["MD"], @@ -173,7 +173,7 @@ class Pkg(ConanFile): with tools.environment_append({"CONAN_USERNAME": "lasote"}): self.packager = ConanMultiPackager(channel="mychannel", gcc_versions=["6"], - visual_versions=["12"], + visual_versions=["16"], archs=["x86", "x86_64"], build_types=["Release"], build_policy="outdated", @@ -185,7 +185,7 @@ class Pkg(ConanFile): "CONAN_BUILD_POLICY": "outdated"}): self.packager = ConanMultiPackager(channel="mychannel", gcc_versions=["6"], - visual_versions=["12"], + visual_versions=["16"], archs=["x86", "x86_64"], build_types=["Release"], ci_manager=ci_manager) @@ -207,7 +207,7 @@ class Pkg(ConanFile): with tools.environment_append({"CONAN_USERNAME": "lasote"}): self.packager = ConanMultiPackager(channel="mychannel", gcc_versions=["6"], - visual_versions=["12"], + visual_versions=["16"], archs=["x86", "x86_64"], build_types=["Release"], build_policy=["cascade", "outdated"], @@ -219,7 +219,7 @@ class Pkg(ConanFile): "CONAN_BUILD_POLICY": "outdated, lib"}): self.packager = ConanMultiPackager(channel="mychannel", gcc_versions=["6"], - visual_versions=["12"], + visual_versions=["16"], archs=["x86", "x86_64"], build_types=["Release"], ci_manager=ci_manager) @@ -425,4 +425,4 @@ def configure(self): tools.save(os.path.join(self.tmp_folder, "conanfile.py"), conanfile) self.packager = ConanMultiPackager(out=self.output.write) self.packager.add_common_builds(pure_c=False, build_all_options_values=["qux:foo", "qux:bar", "qux:blah"]) - self.packager.run() \ No newline at end of file + self.packager.run() diff --git a/cpt/test/test_client/visual_toolsets_test.py b/cpt/test/test_client/visual_toolsets_test.py index 66a292de..29f0ce65 100644 --- a/cpt/test/test_client/visual_toolsets_test.py +++ b/cpt/test/test_client/visual_toolsets_test.py @@ -26,7 +26,7 @@ def test_toolsets_works(self): tc.save({"conanfile.py": self.conanfile}) with environment_append({"CONAN_UPLOAD": ts.fake_url, "CONAN_LOGIN_USERNAME": "user", "CONAN_PASSWORD": "password", "CONAN_USERNAME": "user", - "CONAN_VISUAL_TOOLSETS": "15=v140;v140_xp,11=v140;v140_xp"}): + "CONAN_VISUAL_TOOLSETS": "16=v140;v140_xp,11=v140;v140_xp"}): mulitpackager = get_patched_multipackager(tc, exclude_vcvars_precommand=True) mulitpackager.add_common_builds(reference="lib/1.0@user/stable", shared_option_name=False) @@ -41,4 +41,3 @@ def test_toolsets_works(self): else: self.assertIn("Uploading package 1/2", tc.out) self.assertIn("Uploading package 2/2", tc.out) - diff --git a/cpt/test/unit/generators_test.py b/cpt/test/unit/generators_test.py index 7510cd64..f601860f 100644 --- a/cpt/test/unit/generators_test.py +++ b/cpt/test/unit/generators_test.py @@ -1361,8 +1361,8 @@ def test_visual_build_generator(self): def test_visual_toolsets(self): - builds = get_visual_builds(visual_versions=["15"], archs=["x86"], - visual_runtimes=["MDd"], visual_toolsets={"15": ["v140", + builds = get_visual_builds(visual_versions=["16"], archs=["x86"], + visual_runtimes=["MDd"], visual_toolsets={"16": ["v140", "v140_xp"]}, shared_option_name=None, dll_with_static_runtime=True, @@ -1372,17 +1372,17 @@ def test_visual_toolsets(self): options={}) expected = [ ({'compiler.runtime': 'MDd', 'arch': 'x86', 'build_type': 'Debug', 'compiler': 'Visual Studio', - 'compiler.version': '15', 'compiler.cppstd': '17', 'compiler.toolset': 'v140'}, + 'compiler.version': '16', 'compiler.cppstd': '17', 'compiler.toolset': 'v140'}, {}, {}, {}, None), ({'compiler.runtime': 'MDd', 'arch': 'x86', 'build_type': 'Debug', 'compiler': 'Visual Studio', - 'compiler.version': '15', 'compiler.cppstd': '17', 'compiler.toolset': 'v140_xp'}, + 'compiler.version': '16', 'compiler.cppstd': '17', 'compiler.toolset': 'v140_xp'}, {}, {}, {}, None)] self.assertEquals([tuple(a) for a in builds], expected) # Same with environment passing None in the parameter - with tools.environment_append({"CONAN_VISUAL_TOOLSETS": "15=v140;v140_xp,11=v140;v140_xp"}): - builds = get_visual_builds(visual_versions=["15"], archs=["x86"], + with tools.environment_append({"CONAN_VISUAL_TOOLSETS": "16=v140;v140_xp,11=v140;v140_xp"}): + builds = get_visual_builds(visual_versions=["16"], archs=["x86"], visual_runtimes=["MDd"], visual_toolsets=None, shared_option_name=None, dll_with_static_runtime=True, @@ -1392,8 +1392,8 @@ def test_visual_toolsets(self): options={}) self.assertEquals([tuple(a) for a in builds], expected) - # Invalid mapping generates builds without toolsets (visual 10 != visual 15) - builds = get_visual_builds(visual_versions=["15"], archs=["x86"], + # Invalid mapping generates builds without toolsets (visual 10 != visual 16) + builds = get_visual_builds(visual_versions=["16"], archs=["x86"], visual_runtimes=["MDd"], visual_toolsets={"10": ["v140", "v140_xp"]}, shared_option_name=None, @@ -1404,10 +1404,10 @@ def test_visual_toolsets(self): options={}) expected = [ ({'compiler.runtime': 'MDd', 'arch': 'x86', 'build_type': 'Debug', 'compiler': 'Visual Studio', - 'compiler.cppstd': '14', 'compiler.version': '15'}, + 'compiler.cppstd': '14', 'compiler.version': '16'}, {}, {}, {}, None), ({'compiler.runtime': 'MDd', 'arch': 'x86', 'build_type': 'Debug', 'compiler': 'Visual Studio', - 'compiler.cppstd': '17', 'compiler.version': '15'}, + 'compiler.cppstd': '17', 'compiler.version': '16'}, {}, {}, {}, None)] self.assertEquals([tuple(a) for a in builds], expected) diff --git a/cpt/test/unit/packager_test.py b/cpt/test/unit/packager_test.py index cd5afab3..b590cc26 100644 --- a/cpt/test/unit/packager_test.py +++ b/cpt/test/unit/packager_test.py @@ -32,10 +32,10 @@ def setUp(self): conan_api=self.conan_api, reference="lib/1.0", ci_manager=self.ci_manager) - if "APPVEYOR" in os.environ: - del os.environ["APPVEYOR"] - if "TRAVIS" in os.environ: - del os.environ["TRAVIS"] + + for provider in ["APPVEYOR", "TRAVIS", "GITHUB_ACTIONS"]: + if provider in os.environ: + del os.environ[provider] def _add_build(self, number, compiler=None, version=None): self.packager.add({"os": "os%d" % number, "compiler": compiler or "compiler%d" % number, @@ -938,7 +938,7 @@ def _check_create_calls(skip_recipe_export): output = TestBufferConanOutput() packager = ConanMultiPackager(username="lasote", channel="mychannel", - visual_versions=["12"], + visual_versions=["16"], archs=["x86", "x86_64"], build_types=["Release"], reference="zlib/1.2.11", @@ -954,7 +954,7 @@ def _check_create_calls(skip_recipe_export): self.conan_api.reset() packager = ConanMultiPackager(username="lasote", channel="mychannel", - visual_versions=["12"], + visual_versions=["16"], archs=["x86", "x86_64"], build_types=["Release"], reference="zlib/1.2.11", @@ -970,7 +970,7 @@ def _check_create_calls(skip_recipe_export): self.conan_api.reset() packager = ConanMultiPackager(username="lasote", channel="mychannel", - visual_versions=["12"], + visual_versions=["16"], archs=["x86", "x86_64"], build_types=["Release"], reference="zlib/1.2.11",