TravisCI部署无法找到setup.py

时间:2016-04-14 23:15:51

标签: python github travis-ci pypi

将我的python项目(在GitHub上)自动发布到PyPi似乎相当容易:https://docs.travis-ci.com/user/deployment/pypi/

所以,我在.travis.yml添加了以下内容:

deploy:
  provider: pypi
  user: DanHickstein
  on:
    tags: true
  password:
    secure: GHhpt4Ssv2VQh6...

它几乎可以工作,但我得到TravisCI的以下错误:

Preparing deploy
Authenticated as DanHickstein

Deploying application
python: can't open file 'setup.py': [Errno 2] No such file or directory
ValueError: Cannot find file (or expand pattern): 'dist/*'
python: can't open file 'setup.py': [Errno 2] No such file or directory

我无法理解无法找到setup.py的原因。它与.travis.yml ...

位于同一目录中

1 个答案:

答案 0 :(得分:3)

问题是install阶段的following line

- cd ~/

确保在部署之前回到项目目录的根目录,可能在before_deploy阶段。