pulsar-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] merlimat commented on a change in pull request #2593: Add support for running python functions with wheel file
Date Thu, 20 Sep 2018 16:17:06 GMT
merlimat commented on a change in pull request #2593: Add support for running python functions
with wheel file
URL: https://github.com/apache/incubator-pulsar/pull/2593#discussion_r219228545
 
 

 ##########
 File path: pulsar-functions/instance/src/main/python/python_instance_main.py
 ##########
 @@ -74,6 +73,11 @@ def main():
   args = parser.parse_args()
   function_details = Function_pb2.FunctionDetails()
   json_format.Parse(args.function_details, function_details)
+
+  if os.path.splitext(str(args.py))[1] == '.whl':
+    os.system("unzip -d %s -o %s" % (os.path.dirname(str(args.py)), str(args.py)))
 
 Review comment:
   `unzip` might not be always installed (especially in Docker images where everything is
stripped to bone). 
   Python has a native way to deal with zip files, without invoking the CLI command: https://docs.python.org/3/library/zipfile.html#zipfile.ZipFile.extract

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message