potiuk commented on code in PR #44607:
URL: https://github.com/apache/airflow/pull/44607#discussion_r1874538969


##########
airflow/__init__.py:
##########
@@ -58,10 +58,20 @@
 # very easily cause import cycles in the conf init/validate code (since 
downstream code from
 # those functions likely import settings).
 # configuration is therefore initted early here, simply by importing it.
+
+from packaging.version import Version
+
 from airflow import configuration, settings
 
+
+def get_airflow_version() -> Version:
+    """Return packaging Version object representing the base version."""
+    return Version(Version(__version__).base_version)

Review Comment:
   Likely it could just be a RUFF 
https://docs.astral.sh/ruff/settings/#lint_flake8-import-conventions_banned-from
 if instead adding it to `airflow/__init__.py` you will move it to 
`airflow/version_compat.py` module for example (following what I am proposing 
in #44686 as a solution until 2.11 is set as minimum version. 
   
   Implementing identical module will make it as simple as removing all 
`version_compat.py` from providers and replacing local provider's imports with 
imports from `airflow.version_compat`.
   
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to