You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用Poetry从Azure Artifacts安装私有Python包时避免依赖自动上传

解决Poetry安装依赖时自动上传至Azure DevOps Feed的问题

核心原因

你的Azure DevOps Feed或Poetry配置中,可能误将私有Feed设为公共依赖的自动存储源,或者Poetry默认推送仓库指向了该Feed,导致执行poetry install时公共依赖被自动上传。

解决方案

  • 调整Poetry仓库配置

    1. 执行poetry config repositories查看当前仓库配置,确认Azure DevOps Feed的状态。
    2. 如果该Feed被设为默认仓库,执行poetry config repositories.azure <你的Feed URL>将其添加为专用私有包仓库,默认仓库保持为PyPI即可(无需额外修改,Poetry默认指向PyPI)。
    3. 检查是否配置了poetry config publish.repository azure,如果有则执行poetry config --unset publish.repository取消,避免默认推送至私有Feed。
  • 修改Azure DevOps Feed设置

    1. 进入Azure DevOps的目标私有Feed管理页面。
    2. 打开“上游源”设置项,找到关联的公共源(比如PyPI)。
    3. 取消勾选“保存从上游源安装的包”选项,这样从公共源拉取的依赖就不会自动存入私有Feed。
  • 清理本地缓存并重新安装
    执行poetry cache clear --all pypi清理本地Poetry缓存,之后重新运行poetry install,此时公共依赖只会从PyPI拉取,不会上传至私有Feed。

内容的提问来源于stack exchange,提问作者bball1195

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.05 05:02:33