Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pyproject.toml: project.requires-python = ">=3.11.1,<3.11.2" #8229

Merged
merged 12 commits into from Aug 25, 2023

Conversation

cclauss
Copy link
Collaborator

@cclauss cclauss commented Aug 25, 2023

Ensure GitHub Actions are testing on the same version of Python as production.

      - uses: actions/setup-python@v4
        with:
          python-version-file: pyproject.toml

Arrgghh...

Run actions/setup-python@v4
  with:
    python-version-file: pyproject.toml
    check-latest: false
    token: ***
    update-environment: true
    allow-prereleases: false
Extracted ~=3.11.1 from pyproject.toml
Installed versions
  Successfully set up CPython (3.11.4)

@dariocurr I would like to leverage actions/setup-python#669 to set project.requires-python in pyproject.toml to exactly match 3.11.1 so that our GitHub Actions are testing on the same version of Python as production.

pyproject.toml seems to only be able to parse project.requires-python = "~=3.11.1" (see commits) which given the ~, allows the GitHub Action to upgrade to 3.11.4. Is there any way to force the Action to use 3.11.1?

@cclauss cclauss changed the title pyproject.toml: [project] requires-python = 3.11.1 pyproject.toml: project.requires-python = "~=3.11.1" Aug 25, 2023
@dariocurr
Copy link

I guess: project.requires-python = ">=3.11.1,<3.11.2" should do the trick

@cclauss cclauss changed the title pyproject.toml: project.requires-python = "~=3.11.1" pyproject.toml: project.requires-python = ">=3.11.1,<3.11.2" Aug 25, 2023
Copy link
Collaborator

@scottbarnes scottbarnes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see this forces GitHub actions to use Python 3.11.1. Looks good to me!

@cclauss cclauss merged commit 64ca53e into master Aug 25, 2023
3 checks passed
@cclauss cclauss deleted the pyproject.toml-project.requires-python branch August 25, 2023 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants