-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Upload to PyPI silently fail #858
Comments
I had a similar issue using v0.12.16 where using |
@sdispater I have a fairly good idea why this is happening and a proposal for a fix. In uploader.py resp = session.post(
url,
data=monitor,
allow_redirects=False,
headers={"Content-Type": monitor.content_type},
)
if resp.ok:
bar.finish()
self._io.writeln("") The bug is triggered when the URL is not exactly In summary:
My proposal for the fix is:
This will make Also, it might be a good idea to add a default If this proposal is liked, I'm happy to implement the first two points and open a PR. Point 3 is an improvement. |
Fixes python-poetry#858 by first issuing a HEAD request and following a redirect. This does not cover further redirects though, so it's possible to make this more robust. It does cover the most common use cases (PyPI and TestPyPI will work correctly)
Fixes python-poetry#858 by first issuing a HEAD request and following a redirect. This does not cover further redirects though, so it's possible to make this more robust. It does cover the most common use cases (PyPI and TestPyPI will work correctly)
Can confirm this bug still exists. The fix is really easy, just go to your configuration file ( |
I'm seeing this as well with poetry-1.0.9 with a private pypi server |
I am also seeing this with poetry 1.0.9 with a private pypi server |
Thanks for the reply @abn |
@abn if you look at my analysis above (and compare the state of the code today: https://github.com/python-poetry/poetry/blob/master/poetry/publishing/uploader.py#L262) you will see that the root cause has not been addressed. |
1.1.0b2 has the same problem |
@claeyzre @juyoung-yoo you cannot push to the @sztomi appreciate the analysis. As for the redirects on trailing slashes, we should simply error out gracefully with a message saying what status was returned. So simply ensuring that it is okay and not in the 300 range is what we need. Since different index implentations return different 20X codes for upload unfortunately. We should not try to be smart about recovery since that could end up causing more issues than it solves. We can also revisit this later. I am happy to review a PR on the 300 checks. (#3069) The issue reported here was resolved with #2285. |
I just wanted to add it seems my private repo seemed to have 405 problems with either legacy or simple. I corrected by chopping both off. final url: (note the lack of "legacy" or "simple" Comment that pointed me in that direction: |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I am on the latest Poetry version.
I have searched the issues of this repo and believe that this is not a duplicate.
If an exception occurs when executing a command, I executed it again in debug mode (
-vvv
option).OS version and name: MacOS Mojave
Poetry version: 0.12.10
pyproject.toml
Issue
poetry publish
fails silently if the Pypi server returns an error:I was trying to upload a project with an invalid name ("pipes", invalid because Python standard library has a module named the same) and nothing indicated me that the publishing was failing.
If I try with twine this is the output instead:
I think #742 is a specific case of this issue.
The text was updated successfully, but these errors were encountered: