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


##########
airflow/providers/alibaba/__init__.py:
##########
@@ -29,10 +29,7 @@
 
 __version__ = "2.8.0"
 
-try:
-    from airflow import __version__ as airflow_version
-except ImportError:
-    from airflow.version import version as airflow_version
+from airflow import __version__ as airflow_version

Review Comment:
   Another comment.
   
   I think we should switch to "standard" way of getting airflow version. The 
`__version__` is non-standard (PEP about it has actually been rejected 
https://peps.python.org/pep-0396/) 
   
   I think we've been discussing it with @Taragolis before and 
https://docs.python.org/3/library/importlib.metadata.html is a better/more 
standard way:
   
   ```python
   from importlib.metadata import version  
   airflow_version = version('apache-airlfow')  
   ```
   
   https://docs.python.org/3/library/importlib.metadata.html



-- 
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