Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
default_language_version:
python: python3.10
python: python3
Copy link
Copy Markdown
Collaborator

@tatiana tatiana Dec 5, 2025

Choose a reason for hiding this comment

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

This fails if the person has Python 3.9 installed their local environment. We can pin to another version

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Python 3.9 has reached EOL, and we decided to drop support for Python 3.9

Copy link
Copy Markdown
Contributor Author

@pankajastro pankajastro Dec 5, 2025

Choose a reason for hiding this comment

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

I have a Python 3.11 virtual environment, and I'm hitting an issue. I try to follow the Airflow setting https://github.com/apache/airflow/blob/main/.pre-commit-config.yaml, but please let me know if you want me to test for some other version

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@pankajastro I fully understand, but developers may still have Python 3.9 installed in their local environment, and - this happened to me - unless we tell pre-commit, it may get the incorrect version of Python, which will conflict with pre-commit hooks that do not support that version.
It would be great if we set the minimum acceptable version, or at least the same version that the CI uses. I'm happy for that to be Python 3.11.
To set just Python 3 is not sufficient, I'm afraid

Copy link
Copy Markdown
Contributor Author

@pankajastro pankajastro Dec 8, 2025

Choose a reason for hiding this comment

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

developers may still have Python 3.9 installed in their local environment

I think they should move to Python 3.10 or newer, given pre-commit needs Python 3.10 or newer https://github.com/pre-commit/pre-commit/blob/main/setup.cfg#L26

It would be great if we set the minimum acceptable version

I checked the docs but could not find a way to set the Python min version. Maybe if we want, we can have a local pre-commit

at least the same version that the CI uses

Which CI job are you referring to? I think we run with multiple Python versions, except fews jobs

I'm happy for that to be Python 3.11.

If we set the default to Python 3.11, then it may cause issues for the contributor having Python version 3.10, or 3.12

Please do let me know how we should handle this.


repos:
- repo: local
Expand Down