Skip to content

Conversation

kieran-ryan
Copy link
Member

@kieran-ryan kieran-ryan commented Feb 20, 2024

🤔 What's changed?

Reverted required Python versions from 3.10+ back to 3.8+. Removed Python 3.7.

Added pipeline testing against Python 3.11 and 3.12.

⚡️ What's your motivation?

Support officially supported Python distributions, re-enabling 3.8 and 3.9; to support users appropriately.

repository (main) python3.9 -m pip install cucumber-expressions==17.0.2
ERROR: Ignored the following versions that require a different python version: 17.0.1 Requires-Python >=3.10,<4.0; 17.0.2 Requires-Python >=3.10,<4.0
ERROR: Could not find a version that satisfies the requirement cucumber-expressions==17.0.2 (from versions: 16.0.0, 16.0.1, 16.1.0, 16.1.1, 16.1.2)
ERROR: No matching distribution found for cucumber-expressions==17.0.2

Fixes that test jobs with 3.8 and 3.9 were incorrectly running 3.10.

🏷️ What kind of change is this?

  • 🐛 Bug fix (non-breaking change which fixes a defect)

♻️ Anything particular you want feedback on?

Python 3.7 was not being tested in the pipeline, is unsupported by our version of Poetry and has reached End of Life. Have removed support, let me know if any feedback on that decision.

If the activated Python version in the test job is below the required version of the package, poetry falls back on other installed versions (in this case 3.10). This presents a risk as the pipeline will pass if the required Python version is bumped and not failing for older Python versions still in the pipeline.

The currently activated Python version 3.8.18 is not supported by the project (^3.10).
Trying to find and use a compatible version. 
Using python3.10 (3.10.12)

📋 Checklist:

@kieran-ryan kieran-ryan added the 🐛 bug Defect / Bug label Feb 20, 2024
@kieran-ryan kieran-ryan marked this pull request as draft February 20, 2024 21:16
@kieran-ryan kieran-ryan force-pushed the fix-python-versions branch 2 times, most recently from 5f3a0c9 to f100030 Compare February 20, 2024 21:35
@kieran-ryan kieran-ryan marked this pull request as ready for review February 20, 2024 21:48
@kieran-ryan kieran-ryan changed the title Reenable Python 3.7-3.9 support and extend to 3.11 and 3.12 Reenable Python 3.8-3.9 support and extend to 3.11 and 3.12 Feb 20, 2024
@kieran-ryan kieran-ryan changed the title Reenable Python 3.8-3.9 support and extend to 3.11 and 3.12 Reenable Python 3.8-3.9 support and extend to 3.12 Feb 20, 2024
@mpkorstanje mpkorstanje changed the title Reenable Python 3.8-3.9 support and extend to 3.12 Remove support for Python 3.7 and extend support to 3.12 Feb 20, 2024
Copy link
Contributor

@mpkorstanje mpkorstanje left a comment

Choose a reason for hiding this comment

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

LGTM, feel free to merge after applying the suggestion to the changelog.

Python 3.7 was not being tested in the pipeline, is unsupported by our version of Poetry and has reached End of Life. Have removed support, let me know if any feedback on that decision.

Usually, we only do the latest two stable releases. This avoids a plethora of CI jobs (and the potential headaches that come with having to support many versions). But supporting more versions is fine. As long as they're not EOL.

If the activated Python version in the test job is below the required version of the package, poetry falls back on other installed versions (in this case 3.10). This presents a risk as the pipeline will pass if the required Python version is bumped and not failing for older Python versions still in the pipeline.

I'm not sure I follow this. The matrix job should install only a single version of python. How can it fall back to a version that wasn't installed by the job?

@kieran-ryan
Copy link
Member Author

If the activated Python version in the test job is below the required version of the package, poetry falls back on other installed versions (in this case 3.10). This presents a risk as the pipeline will pass if the required Python version is bumped and not failing for older Python versions still in the pipeline.

I'm not sure I follow this. The matrix job should install only a single version of python. How can it fall back to a version that wasn't installed by the job?

The ubuntu-latest GitHub runner uses Ubuntu 22.04, which packages Python 3.10.12.

Poetry was set to 3.10 upwards:

[tool.poetry.dependencies]
python = "^3.10"

And the test job was configured for Python 3.8-3.10.

python-version: ["3.8", "3.9", "3.10"]

However, rather than fail with 3.8 and 3.9, poetry looks for a compatible Python version, finding 3.10 of ubuntu-latest. As a result, each of the test jobs ran against 3.10 and passed - rather than fail for 3.8 and 3.9. Using a virtual environment should prevent this, however. See job #5715.

The currently activated Python version 3.8.18 is not supported by the project (^3.10).
Trying to find and use a compatible version. 
Using python3.10 (3.10.12)

@kieran-ryan kieran-ryan merged commit abf8e7f into main Feb 22, 2024
@kieran-ryan kieran-ryan deleted the fix-python-versions branch February 22, 2024 22:33
@kieran-ryan kieran-ryan self-assigned this Feb 22, 2024
@mpkorstanje
Copy link
Contributor

Thanks for explaining! Very clear.

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

Labels

🐛 bug Defect / Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants