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

Specific Python patch versions (vX.Y.Z) are not respected? #194

Open
SyntaxColoring opened this issue Apr 18, 2024 · 2 comments
Open

Specific Python patch versions (vX.Y.Z) are not respected? #194

SyntaxColoring opened this issue Apr 18, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@SyntaxColoring
Copy link

Describe the bug

If you have a config like this...

[gh-actions]
python =
    3.10.8: py3108
    3.10: py310

...and your GitHub Actions configuration installs 3.10.8, this plugin will select the py310 environment instead of the py3108 environment.

To Reproduce

GitHub Action snippet:

    - uses: actions/setup-python@v5
      with:
        python-version: 3.10.8

tox.ini snippet:

[testenv: py3108]
basepython = python3.10.8

[gh-actions]
python =
    3.8: py38
    3.9: py39
    3.10.8: py3108
    3.10: py310
    3.11: py311
    3.12: py312

The PR where I noticed this, showing the full configurations: pytest-dev/pytest-asyncio#817

And the specific job where I noticed this: https://github.com/pytest-dev/pytest-asyncio/actions/runs/8732675787/job/23960070899?pr=817

Expected behavior

I expect to be able to write major.minor.patch versions like 3.10.8 in my tox.ini's [gh-actions] section. If I write 3.10.8, I expect that to match a runner version of 3.10.8 but not 3.10.9. If I write just 3.10, I expect that to match a runner version of 3.10.8 or 3.10.9. If multiple entries in my tox.ini config match the runner version, I guess I expect the lexicographically first one to be used.

Additional context

N/A

@ymyzk ymyzk added the enhancement New feature or request label Apr 23, 2024
@ymyzk
Copy link
Owner

ymyzk commented Apr 23, 2024

Hello @SyntaxColoring. Thanks for filing a ticket!

The problem should be caused by the fact that tox-gh-actions doesn't expect major.minor.patch as a key of gh-actions.python at this point. Here's the relevant code:

else:
# Assume this is running on CPython
return [major_minor_version, major_version]

I think it makes sense to add the patch version support to tox-gh-actions. If you're open to create a MR for this change, feel free to do so. I might not be able to find time to implement this improvement by myself right now.

@SyntaxColoring
Copy link
Author

Yep, I'm happy to give it a shot. It'll probably be a while before I get around to it, too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants