From 2358cf786d7f7780656d9f0fc6cfb45ae865ca2e Mon Sep 17 00:00:00 2001 From: Pedro Brochado Date: Wed, 27 Nov 2024 15:00:17 -0300 Subject: [PATCH] Apply plugin_template --- .ci/scripts/check_release.py | 5 ++++- .ci/scripts/check_requirements.py | 5 ++++- .github/template_gitref | 2 +- .github/workflows/ci.yml | 3 +++ .github/workflows/nightly.yml | 4 ++++ .github/workflows/scripts/before_install.sh | 6 +++--- .github/workflows/scripts/publish_plugin_pypi.sh | 4 ++-- .github/workflows/test.yml | 14 +++++--------- pyproject.toml | 6 +++++- 9 files changed, 31 insertions(+), 18 deletions(-) diff --git a/.ci/scripts/check_release.py b/.ci/scripts/check_release.py index 095dd739b..da45be6a8 100755 --- a/.ci/scripts/check_release.py +++ b/.ci/scripts/check_release.py @@ -37,7 +37,10 @@ def template_config(): def current_version(repo, commitish): try: pyproject_toml = tomllib.loads(repo.git.show(f"{commitish}:pyproject.toml")) - current_version = pyproject_toml["project"]["version"] + try: + current_version = pyproject_toml["project"]["version"] + except Exception: + current_version = pyproject_toml["tool"]["bumpversion"]["current_version"] except Exception: current_version = repo.git.grep( "current_version", commitish, "--", ".bumpversion.cfg" diff --git a/.ci/scripts/check_requirements.py b/.ci/scripts/check_requirements.py index 28bf8e53b..c0c883a9d 100755 --- a/.ci/scripts/check_requirements.py +++ b/.ci/scripts/check_requirements.py @@ -62,7 +62,10 @@ def main(): else: if check_prereleases and req.specifier.prereleases: # Do not even think about begging for more exceptions! - if req.name != "pulp-container-client": + if ( + not req.name.startswith("opentelemetry") + and req.name != "pulp-container-client" + ): errors.append(f"{filename}:{nr}: Prerelease versions found in {line}.") ops = [spec.operator for spec in req.specifier] if "~=" in ops: diff --git a/.github/template_gitref b/.github/template_gitref index 8156a7ac1..70eef8995 100644 --- a/.github/template_gitref +++ b/.github/template_gitref @@ -1 +1 @@ -2021.08.26-399-g78ad960 +2021.08.26-405-g3845bbc diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0daac910c..7c561551f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,6 +56,9 @@ jobs: test: needs: "build" uses: "./.github/workflows/test.yml" + with: + matrix_env: | + [{"TEST": "pulp"}, {"TEST": "azure"}, {"TEST": "s3"}, {"TEST": "lowerbounds"}] deprecations: runs-on: "ubuntu-latest" diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 233819a11..dfa570d63 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -29,6 +29,9 @@ jobs: test: needs: "build" uses: "./.github/workflows/test.yml" + with: + matrix_env: | + [{"TEST": "pulp"}, {"TEST": "azure"}, {"TEST": "s3"}, {"TEST": "lowerbounds"}] changelog: runs-on: ubuntu-latest @@ -65,3 +68,4 @@ jobs: branch: "changelog/update" delete-branch: true path: "pulp_container" +... diff --git a/.github/workflows/scripts/before_install.sh b/.github/workflows/scripts/before_install.sh index f68a2eaf3..e0f372bf1 100755 --- a/.github/workflows/scripts/before_install.sh +++ b/.github/workflows/scripts/before_install.sh @@ -30,7 +30,7 @@ fi COMMIT_MSG=$(git log --format=%B --no-merges -1) export COMMIT_MSG -COMPONENT_VERSION=$(sed -ne "s/\s*version.*=.*['\"]\(.*\)['\"][\s,]*/\1/p" setup.py) +COMPONENT_VERSION=$(python3 -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])") mkdir .ci/ansible/vars || true echo "---" > .ci/ansible/vars/main.yaml @@ -61,10 +61,10 @@ then fi if [[ "$TEST" = "pulp" ]]; then - python3 .ci/scripts/calc_constraints.py -u requirements.txt > upperbounds_constraints.txt + python3 .ci/scripts/calc_constraints.py -u pyproject.toml > upperbounds_constraints.txt fi if [[ "$TEST" = "lowerbounds" ]]; then - python3 .ci/scripts/calc_constraints.py requirements.txt > lowerbounds_constraints.txt + python3 .ci/scripts/calc_constraints.py pyproject.toml > lowerbounds_constraints.txt fi if [ -f $POST_BEFORE_INSTALL ]; then diff --git a/.github/workflows/scripts/publish_plugin_pypi.sh b/.github/workflows/scripts/publish_plugin_pypi.sh index 267ee53e6..bf6071bc5 100755 --- a/.github/workflows/scripts/publish_plugin_pypi.sh +++ b/.github/workflows/scripts/publish_plugin_pypi.sh @@ -28,6 +28,6 @@ then fi twine upload -u __token__ -p "$PYPI_API_TOKEN" \ -"dist/pulp_container-$VERSION-py3-none-any.whl" \ -"dist/pulp-container-$VERSION.tar.gz" \ +dist/pulp?container-"$VERSION"-py3-none-any.whl \ +dist/pulp?container-"$VERSION".tar.gz \ ; diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b9eceb261..cf850049f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,6 +9,10 @@ name: "Test" on: workflow_call: + inputs: + matrix_env: + required: true + type: string defaults: run: @@ -20,11 +24,7 @@ jobs: strategy: fail-fast: false matrix: - env: - - TEST: pulp - - TEST: azure - - TEST: s3 - - TEST: lowerbounds + env: ${{ fromJSON(inputs.matrix_env) }} steps: - uses: "actions/checkout@v4" @@ -88,10 +88,6 @@ jobs: ANSIBLE_FORCE_COLOR: "1" GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" GITHUB_CONTEXT: "${{ github.event.pull_request.commits_url }}" - - uses: ruby/setup-ruby@v1 - if: ${{ env.TEST == 'pulp' }} - with: - ruby-version: "2.6" - name: "Install" run: | diff --git a/pyproject.toml b/pyproject.toml index 685d2f246..26321c849 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -113,4 +113,8 @@ search = "version = \"{current_version}\"" replace = "version = \"{new_version}\"" [[tool.bumpversion.files]] -filename = "./setup.py" +# This section is managed by the plugin template. Do not edit manually. + +filename = "./pyproject.toml" +search = "version = \"{current_version}\"" +replace = "version = \"{new_version}\"" \ No newline at end of file