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

Bump Python requirement dynamically #448

Merged
merged 1 commit into from
Sep 28, 2022

Conversation

felixfontein
Copy link
Collaborator

@felixfontein
Copy link
Collaborator Author

Long-term we should find a better mechanism which extracts the minimum Python requirement from ansible-core and stores it in the .build file, to avoid this hacky heuristic :)

@@ -176,7 +176,8 @@ setup(
{%- if version.major < 5 %}
python_requires='>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*',
{%- else %}
python_requires='>=3.8',
{# Ansible X depends on ansible-core 2.(X+7), which depends on Python 3.(floor((X+11)/2)) - at least for now :) #}
python_requires='>=3.{{ ((version.major + 11) / 2) | round(0, 'floor') }}',
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Verified manually:

Ansible 5 → 3.8
Ansible 6 → 3.8
Ansible 7 → 3.9
Ansible 8 → 3.9
Ansible 9 → 3.10

@felixfontein felixfontein merged commit 6801daf into ansible-community:main Sep 28, 2022
@felixfontein felixfontein deleted the python branch September 28, 2022 21:29
@felixfontein
Copy link
Collaborator Author

@rooftopcellist @Ompragash thanks for reviewing this!

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.

Make sure ansible-core's new Python requirements are used in the Ansible 7 package
3 participants