FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Running github action with package version below 3.12 · Issue #932 · python-semantic-release/python-semantic-release · GitHub

Repository navigation

Running github action with package version below 3.12 #932

Description

Hello team,

My and my team at open-targets were using the github-actions provided by the python-semantic-release inside our release pipeline. https://github.com/opentargets/gentropy/actions/runs/9128164374/job/25099956750

Our codebase uses python3.10, we do not allow newer version(s).

The change introduced in the #914 that bumps the docker image from python3.10 to 3.12 https://github.com/python-semantic-release/python-semantic-release/pull/914/files#diff-dd2c0eb6ea5cfc6c4bd4eac30934e2d5746747af48fef6da689e85b752f39557L2 breaks our build.

My question is following, is there a way to set the python version that the semantic-release should use for package build within the actions?

Thanks for your work,
Cheers!

Activity

  1. codejedi365 commented on May 17, 2024

    Contributor

    @project-defiant, there is not a way to set the python version used by the GitHub Action while it is set up as a Docker Action.

    PR #741 suggests a move to a Composite GitHub Action which likely will provide an avenue for user defined python version support as an action. This change is determined to be a breaking change and likely will not be merged in the near term.

    I won't be reverting #914 as many consumers were asking for >=3.11 and ==3.12 build environments and I am trying to keep PSR supporting the latest and widest availability.

    My recommendation is to just use the generic shell runtime environment to use PSR. If your project is a python project using pyproject.toml, you can place your configuration into this file. You can also utilize a releaserc.toml file for non-pyproject-toml projects. You may not need a configuration if you prefer all of our standard defaults. The following Action snippet should accomplish what you desire:

    env:
      PYTHON_VERSION: 3.10
    
    steps:
      - uses: actions/checkout@v4
        with:
            fetch-depth: 0
      
      - name: Set up Python ${{ env.PYTHON_VERSION }}
        uses: actions/setup-python@v5
        with:
          python-version: ${{ env.PYTHON_VERSION }}
    
      - name: Python Semantic Release
        run: |
          python -m pip install python-semantic-release~=9.0
          semantic-release version
    
        # this last line depends if the python bin was on your path
        # otherwise use python -m semantic_release <cmd> <args>
    
        # if you are using releaserc.toml make sure to specify that in the command line arguments
  2. project-defiant commented on May 17, 2024

    Author

    Thank you for the explanation, we have fortunately solved the issue by dumping the version to the former release using python3.10 for now, before we transition to wider range of python versions. We may still use your example though.

    Thank you for your time. Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL