You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/07/26 04:18:51 UTC

[GitHub] [airflow] uranusjr opened a new pull request, #25296: Only load distribution of a name once

uranusjr opened a new pull request, #25296:
URL: https://github.com/apache/airflow/pull/25296

   This mimics the import system's behavior -- package of a name in front of `sys.path` "shadows" the one in the back, and should avoid a package from being loaded multiple times, if its containing directory appears multiple times in `sys.path`.
   
   This also causes a side effect: if there are **different** plugins of the same name, previously the one later in `sys.path` would have been discovered, but now it wouldn't. I think this is a reasonable compromise, since loading multiple packages of one same name is never a good idea in
   Python in the first place, and we should have been careful to preclude the possibility to begin with.
   
   Should fix #25271. cc @rino0601 @bmoon4


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] uranusjr merged pull request #25296: Only load distribution of a name once

Posted by GitBox <gi...@apache.org>.
uranusjr merged PR #25296:
URL: https://github.com/apache/airflow/pull/25296


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] uranusjr commented on pull request #25296: Only load distribution of a name once

Posted by GitBox <gi...@apache.org>.
uranusjr commented on PR #25296:
URL: https://github.com/apache/airflow/pull/25296#issuecomment-1202197883

   I’ve added a test for the function.


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] uranusjr commented on a diff in pull request #25296: Only load distribution of a name once

Posted by GitBox <gi...@apache.org>.
uranusjr commented on code in PR #25296:
URL: https://github.com/apache/airflow/pull/25296#discussion_r936287827


##########
airflow/plugins_manager.py:
##########
@@ -113,7 +113,7 @@ class EntryPointSource(AirflowPluginSource):
     """Class used to define Plugins loaded from entrypoint."""
 
     def __init__(self, entrypoint: importlib_metadata.EntryPoint, dist: importlib_metadata.Distribution):
-        self.dist = dist.metadata['name']
+        self.dist = dist.metadata['Name']

Review Comment:
   Python pacakge metadata keys are case-insensitive, I use `Name` ([the case used by the standard](https://packaging.python.org/en/latest/specifications/core-metadata/)) everywhere so tests are easier to write.



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] potiuk commented on pull request #25296: Only load distribution of a name once

Posted by GitBox <gi...@apache.org>.
potiuk commented on PR #25296:
URL: https://github.com/apache/airflow/pull/25296#issuecomment-1203749614

   Looks green now. @ashb ?


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] potiuk commented on pull request #25296: Only load distribution of a name once

Posted by GitBox <gi...@apache.org>.
potiuk commented on PR #25296:
URL: https://github.com/apache/airflow/pull/25296#issuecomment-1203140230

   Tests failing :(


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org