-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
Use importlib_metadata
with compat to Python 3.10/3.12 stdlib
#38366
Conversation
Not related to this one, but we also use airflow/airflow/providers_manager.py Lines 49 to 52 in 83e83e2
|
Ok.. seems like only one test should be fixed |
Need to fix mocked method |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rebase and merge @Taragolis ? |
Yep, I will do it in the morning, I'm out of laptop |
f53303f
to
9b53dd7
Compare
That what I've accidentally found, that we install
importlib_metadata
only for Python 3.8 however in some places we might use in more modern versions of the Python when we useRight now
importlib_metadata
as well as (importlib_resources
) presented into the Docker Image (2.8.4rc1), more like it comes from one of the dependency.So this could be a situation that we unintendedly use some features from the backported packages and it works as expected, because this package also provide new feature which will added into the
stdlib
in the future, see compat tableI've tried to found places where the behavior in stdlib changed (https://docs.python.org/3/library/importlib.metadata.html), and only found two places which we use in Airflow code base
This PR is attempt to prevent that something work just because some dependency install
importlib_metadata
and our code just always useimportlib_metadata
if it installed. This might help to detect some minor/major incompatabilities^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rst
or{issue_number}.significant.rst
, in newsfragments.