Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Packages not uploaded to PyPI: sh: 1: twine: not found #299

Closed
koterpillar opened this issue Aug 7, 2015 · 20 comments
Closed

Packages not uploaded to PyPI: sh: 1: twine: not found #299

koterpillar opened this issue Aug 7, 2015 · 20 comments
Milestone

Comments

@koterpillar
Copy link
Contributor

In this build:

https://travis-ci.org/koterpillar/aloe/jobs/74553631

the package isn't being released to PyPI, and there is an error message in the log:

sh: 1: twine: not found
@zupo
Copy link

zupo commented Aug 12, 2015

I have the same issue. @koterpillar did you find any workarounds?

@koterpillar
Copy link
Contributor Author

My current workaround is to upload manually. I suppose installing twine manually would also be an option.

@zupo
Copy link

zupo commented Aug 12, 2015

So, I did a bit of digging around and found the culprit.

First, one needs to install twine with pip install twine in before_deploy step. The deploy code runs OK then.

However it breaks where it calls twine if you do a deploy to a custom PyPI server. The problem is how the ~/.pypirc file is built and how twine is called.

The ~/.pypirc file built by dpl is something like this:

[distutils]
index-servers =
    pypi

[pypi]
repository: https://my.own.pypi.com/pypi
username: foo
password: bar

But when twine is called, dpl passes the #{options[:server] || 'pypi’} option, meaning it tells twine to look for the https://my.own.pypi.com/pypi section. And there is only pypi section in the built ~/.pypirc file.

So dpl should either build the ~/.pypirc file in a way where the options[:server] is used for index-servers and the section title OR always call twine with -r pypi. The latter option is probably simpler and hence, better. The offending line:

context.shell "twine upload -r #{options[:server] || 'pypi'} dist/*"

@cotsog
Copy link
Contributor

cotsog commented Aug 14, 2015

We issued an intermediate fix for this.

In addition to manually install twine, you need to add edge: true to your deploy: section in your .travis.yml file:

deploy:
  provider: pypi
  edge: true
  ...

Hope this helps.

@dhermes
Copy link

dhermes commented Aug 14, 2015

Thanks for the fix. (Can you send a link to it?) What does edge: true do?

@BanzaiMan
Copy link
Contributor

@dhermes edge: true runs the deployment with the pre-release version that has a successful build (https://travis-ci.org/travis-ci/dpl/builds/75469158) until there is a release.

BanzaiMan added a commit that referenced this issue Aug 17, 2015
twine does not work well with virtualenv, and this caused issues
such as #296 and
#299.

This commit aims to fix the problem by installing twine without
`--user`, which is suggested in #299 (comment)
@BanzaiMan
Copy link
Contributor

I pushed to the master branch another commit, which aims to address the problem with the twine installation. Could any of you try deployment with edge: true, but without installing twine prior to the deployment?

@koterpillar
Copy link
Contributor Author

edge: true, without manually installing twine, worked for me just now.

2015-08-18 5:05 GMT+10:00 Hiro Asari notifications@github.com:

I pushed to the master branch another commit, which aims to address the
problem with the twine installation. Could any of you try deployment with edge:
true, but without installing twine prior to the deployment?


Reply to this email directly or view it on GitHub
#299 (comment).

@BanzaiMan
Copy link
Contributor

Great! I've released 1.7.19. edge: true is no longer necessary.

@tlocke
Copy link

tlocke commented May 24, 2016

This error seems to have recurred:

sh: 1: twine: not found

I tried @zupo's fix:

before_deploy:
    pip install twine

but this gives the error:

pkginfo is in an unsupported or invalid wheel

Any help appreciated, thanks!

@fpagnoux
Copy link

fpagnoux commented May 24, 2016

I have the same error.
There seems to be an error while Installing deploy dependencies:

pkginfo is in an unsupported or invalid wheel

@BanzaiMan
Copy link
Contributor

Sorry about the issue. Could you point us to a build log URL that shows the problem?

@tlocke
Copy link

tlocke commented May 24, 2016

Yes it's at line 3678 at:

https://travis-ci.org/WessexWater/chellow/builds/132497112#L3678

Even though the build is green the deployment to PyPI failed.

@BanzaiMan
Copy link
Contributor

Thanks for the information. Whatever the regression is, I think the issue should be handled anew. Please open a new ticket.

@tlocke
Copy link

tlocke commented May 24, 2016

As requested I've opened a new issue #453 for this.

@bergwerf
Copy link

I also failed to auto publish my package with the same error: https://travis-ci.org/hermanbergwerf/bashbeautify/builds/141048289#L245

@BanzaiMan
Copy link
Contributor

@hermanbergwerf Could you try rerunning the build? I think pip install twine might have failed for you for whatever reason.

@bergwerf
Copy link

I have retried the build several times, but I did not add pip install twine. Is that still required? It is not mentioned on https://docs.travis-ci.com/user/deployment/pypi.

@BanzaiMan
Copy link
Contributor

pip install twine is invoked by our utility.

I see the failure here: https://travis-ci.org/hermanbergwerf/bashbeautify/builds/141048289#L202.

I think this is a regression, so please open a new issue. Thanks.

@bergwerf
Copy link

See #470

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants