jiangpengcheng commented on code in PR #16697:
URL: https://github.com/apache/pulsar/pull/16697#discussion_r925359070
##########
pulsar-functions/instance/src/main/python/python_instance_main.py:
##########
@@ -123,21 +123,21 @@ def main():
# run pip install to target folder deps folder
zpfile = zipfile.ZipFile(str(args.py), 'r')
zpfile.extractall(os.path.dirname(str(args.py)))
- basename = os.path.splitext(str(args.py))[0]
+ basename = os.path.basename(os.path.splitext(str(args.py))[0])
deps_dir = os.path.join(os.path.dirname(str(args.py)), basename, "deps")
if os.path.isdir(deps_dir) and os.listdir(deps_dir):
# get all wheel files from deps directory
wheel_file_list = [os.path.join(deps_dir, f) for f in
os.listdir(deps_dir) if os.path.isfile(os.path.join(deps_dir, f)) and
os.path.splitext(f)[1] =='.whl']
- cmd = "pip install -t %s --no-index --find-links %s %s" %
(os.path.dirname(str(args.py)), deps_dir, " ".join(wheel_file_list))
+ cmd = "pip install -t %s --no-index --find-links %s %s" %
(os.path.dirname(os.path.abspath(str(args.py))), deps_dir, "
".join(wheel_file_list))
Review Comment:
`os.path.dirname(str(args.py))` can be an empty value which will make the
pip install deps to the `--no-index` directory
--
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]