Pypi deployment fails with 'module' object is not callable

The script used to work fine, but recently we started to see an ‘module’ object is not callable error:

https://travis-ci.org/rainwoodman/bigfile/jobs/598403069

Reverting to 1.8.45 is a temporary workaround:

The github ticket has been closed, thus I am posting here.

(https://github.com/travis-ci/travis-ci/issues/9303)

Thanks!

1 Like

You are arranging for the upload logic (changes in pypi.rb between v1.8.45 and the latest v1 release as of this writing) to be run in a custom Anaconda Python environment which it wasn’t designed for. So you are the one responsible for dealing with the fallout here.

Though Travis may accept changes that would make it easier for you, at their discretion.

In particular, your environment seems to already have another version of pip and possibly other related modules that may not be compatible with those installed by the logic and/or be overriding them.


Possible solutions that I see from the top of my head:

  • uninstall conda packages that provide pip and possibly setuptools, wheel, twine from your environment before the deploy stage.
  • suggest a change that would avoid installing the aforementioned packages if they are already present in the active Python installation (i.e. the one currently assigned to `python’) unless a specific version was requested.
  • Do not use the deployment provider but install and run twine manually instead, e.g. in the after_success: phase.