我正在写一个简单的 IronWorker in Python使用 AWS API 做一些工作。
为此,我想使用 boto library通过 PiPy 分发。 IronWorker 运行时环境默认不安装 boto 库。
如何将 boto 库依赖项与我的 IronWorker 代码捆绑在一起?
理想情况下,我希望我可以使用类似 gem dependancy bundling available for Ruby IronWorkers 的东西- 即在 myRuby.worker
中指定
gemfile '../Gemfile', 'common', 'worker' # merges gems from common and worker groups
在Python Loggly sample ,我看到使用了 hoover 库:
#here we have to include hoover library with worker.
hoover_dir = os.path.dirname(hoover.__file__)
shutil.copytree(hoover_dir, worker_dir + '/loggly') #copy it to worker directory
但是,我看不到你在哪里/如何指定你想要的 hoover 库版本,或者从哪里下载它。
在 Python IronWorkers 中使用第三方库的官方/正确方法是什么?
最佳答案
较新的 iron_worker 版本原生支持 pip
命令。
所以,你需要:
runtime "python"
exec "something.py"
pip "boto"
pip "someotherpip"
full_remote_build true
关于python - 如何在 IronWorker 中捆绑 Python 依赖项?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13285901/