Pypi deployment with Python 3 in an R build

python

#1

I’m running an R build and manually installing python 3, since my repo requires both. I would like to include a deploy command at the end to send the built python package to pypi. Unfortunately, travis uses python2 for the deploy, which fails to build since my package is python3 only.

Is there any way to force travis not to use system python here?

My config is at https://travis-ci.com/KrishnaswamyLab/MAGIC/jobs/179988917/config

Thanks!


#2

According to https://github.com/travis-ci/dpl/blob/master/lib/dpl/provider/pypi.rb , pypi deployer is hard-wired to invoke python, twine and pip. So you need to override those commands. Creating symlinks in ~/bin (or whatever is early on PATH) in before_deploy: comes to mind.


#3

Great, thanks! That looks to have done the job.


#4

Oh, and running the build in a virtualenv (as it also overrides python and commands for installed scripts) is an all-time favorite :slight_smile: (I completely forgot about that!)