97amarnathk
97amarnathk

Reputation: 1035

Travis CI : Switch to python 3 temporarily

Okay, so I am trying to generate and deploy the documentation of a Python 2.7 based package. The documentation is generated using sphinx, python 2.7.

However, to actually deploy the documentation, I need to use a tool called doctr. This automatically deploys the generated html to github pages. However it requires me to work on Python 3.5 or newer.

So the question is : When the entire travis build is running on python 2.7, how do I temporarily shift to python 3.5 and deploy the documentation?

Upvotes: 1

Views: 301

Answers (1)

brujoand
brujoand

Reputation: 855

You can use pyenv to install 3.5 if not already present, and change to it, do your thing, and change back.

Basically this;

pyenv install 3.5.0
pyenv global 3.5.0
<do the deploy>
pyenv global <previous version>

Upvotes: 1

Related Questions