使用Travis-CI将多个发行版部署到PyPI时防止冲突

todofixthis

每当新的提交到达master分支时,我都希望Travis CI构建以下工件并将其部署到PyPI

  • Python 2轮子
  • Python 3轮
  • 资源

为了实现这一点,我将以下内容添加到.travis.yml

language: python
python:
  - '2.7'
  - '3.5'
  - '3.6'
deploy:
  on:
    branch: master
  provider: pypi
  distribution: bdist_wheel sdist

对于正常的构建/测试,该配置非常有效。但是,在部署到PyPI时会引入竞争条件

Uploading distributions to https://upload.pypi.org/legacy/
Uploading PyOTA-2.0.0b1.tar.gz
HTTPError: 400 Client Error: File already exists. for url: https://upload.pypi.org/legacy/

.travis.yml为了使Travis CI能够将正确的伪像部署到PyPI,我应该进行哪些更改

用户名

我今天遇到了这个问题,最终发现了这个文档不足的宝石:

deploy:
  provider: pypi
  skip_existing: true
  ...

skip_existing: true即使我在几个不同的配置和python版本上进行了测试,我仍在一个项目上使用一次来发布源代码和车轮。便利。有关已解决的github问题的更多详细信息我还提交了文档差异

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章