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

Upload to TestPyPI silently failed. #742

Closed
kk6 opened this issue Dec 15, 2018 · 16 comments
Closed

Upload to TestPyPI silently failed. #742

kk6 opened this issue Dec 15, 2018 · 16 comments
Labels
status/duplicate Duplicate issues

Comments

@kk6
Copy link

kk6 commented Dec 15, 2018

  • [x ] I am on the latest Poetry version.
  • [x ] I have searched the issues of this repo and believe that this is not a duplicate.
  • [x ] If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).

Issue

I tried uploading the test package to TestPyPI using Poetry.

~/s/kk6-demo $ poetry config repositories.testpypi https://test.pypi.org/simple
~/s/kk6-demo $ poetry publish -r testpypi

Publishing kk6-demo (0.1.0) to testpypi
Username: kk6



Password:

 - Uploading kk6-demo-0.1.0.tar.gz 100%
 - Uploading kk6_demo-0.1.0-py3-none-any.whl 100%

As far as looking at the output, the upload seems to be successful. However, when I look at TestPyPI's own project list, I can not find the package I uploaded earlier.

So, trying uploading in the same way using twine as a test, HTTPError: 400 Client Error returned.

~/s/kk6-demo $ poetry run twine upload --repository-url https://test.pypi.org/legacy/ dist/*
Enter your username: kk6
Enter your password:
Uploading distributions to https://test.pypi.org/legacy/
Uploading kk6_demo-0.1.0-py3-none-any.whl
100%|██████████████████████████████████████████████████████████████████████████████| 3.77k/3.77k [00:01<00:00, 2.36kB/s]
Uploading kk6_demo-0.1.1-py3-none-any.whl
100%|██████████████████████████████████████████████████████████████████████████████| 3.77k/3.77k [00:01<00:00, 3.13kB/s]
Uploading kk6-demo-0.1.0.tar.gz
100%|██████████████████████████████████████████████████████████████████████████████| 3.49k/3.49k [00:00<00:00, 9.05kB/s]
NOTE: Try --verbose to see response content.
HTTPError: 400 Client Error: 'None' is an invalid value for Home-Page. Error: Invalid URI See https://packaging.python.org/specifications/core-metadata for url: https://test.pypi.org/legacy/

It seems to be caused by not setting the homepage, so I added the following settings to pyproject.toml.

[tool.poetry]
...
homepage = "https://github.com/kk6/kk6-demo"

When I tried uploading again with Poetry, I succeeded this time.

~/s/kk6-demo $ poetry config repositories.testpypi https://test.pypi.org/legacy/
~/s/kk6-demo $ poetry publish -r testpypi

Publishing kk6-demo (0.1.0) to testpypi
Username: kk6



Password:

 - Uploading kk6-demo-0.1.0.tar.gz 100%
 - Uploading kk6_demo-0.1.0-py3-none-any.whl 100%

This time it was added to https://test.pypi.org/manage/projects/ properly.

If homepage is not set in pyproject.toml, I think that Poetry probably received HTTPError: 400 Client Error, but in that case I thought that should be displayed.

@sdispater
Copy link
Member

Thanks for reporting this!

I am not sure why the upload does not fail when it should but this is definitely a bug.

I will investigate and get back to you.

@sdispater sdispater added kind/bug Something isn't working as expected area/publishing Related to PyPI/PEP 503 publishing labels Dec 15, 2018
@jgirardet
Copy link
Contributor

Related to #239 ?

@kk6
Copy link
Author

kk6 commented Dec 16, 2018

@jgirardet I guess so. I tried the same thing as your comment on #239 .

>>> subprocess.check_output('poetry --version', shell=True).decode()
'Poetry 0.12.10\n'
>>> subprocess.check_call('poetry publish -r testpypi --username kk6 --password PASSWORD', shell=True)

Publishing kk6-demo (0.1.0) to testpypi
 - Uploading kk6-demo-0.1.0.tar.gz 100%
 - Uploading kk6_demo-0.1.0-py3-none-any.whl 100%
0

Actually, the package could not be uploaded.

@patarapolw
Copy link

Thanks for posting this.

My poetry publish SILENTLY fails, with exit code 0, but

$ poetry add twine --dev
$ poetry run twine upload dist/*

succeeded.

@kbakk
Copy link
Contributor

kbakk commented Jan 25, 2019

I noticed similar behavior against devpi-server. My mistake was to use url = "https://<internal server url>/kristofferb/dev/simple+/". Using https://<internal server url>/kristofferb/dev/ instead fixed this.

I found by looking at the server log that the server responded with a 200 http code:

2019-01-25 22:21:09,720 INFO  [req4] POST /kristofferb/dev/+simple/
2019-01-25 22:21:09,721 DEBUG [req4] [Wtx2027] in-transaction 2027
2019-01-25 22:21:09,722 INFO  [req4] starting +simple
2019-01-25 22:21:10,372 DEBUG [req4] [Wtx2027] nothing to commit, just closing tx
2019-01-25 22:21:10,372 DEBUG [req4] [Wtx2027] closing transaction at 2027
2019-01-25 22:21:10,373 DEBUG [req4] 200 0.652s serial=2027 length=7718140 type=text/html; charset=UTF-8

Using the correct URL, the log indicates that the server responds with a 200 http code:

2019-01-25 22:22:56,801 INFO  [req9] POST /kristofferb/dev/
2019-01-25 22:22:56,802 DEBUG [req9] [Wtx2027] in-transaction 2027
2019-01-25 22:22:56,826 DEBUG detected 'argon2_cffi' backend, version '18.3.0', with support for 0x13 argon2 hashes
2019-01-25 22:22:57,010 DEBUG [req9] got auth status 'ok' for user 'kristofferb'
 <snip>
2019-01-25 22:22:57,349 DEBUG [req9] [Wtx2027] closing transaction at 2027
2019-01-25 22:22:57,349 DEBUG [req9] 200 0.548s serial=2028 length=0 type=text/html; charset=UTF-8

@ghost ghost mentioned this issue Feb 3, 2019
3 tasks
@9maf4you
Copy link

This behavior is common for most poetry commands I guess.
After running tests it looks like:

$ poetry run pytest
============================= test session starts ==============================
.....
.....

tests/test_iptables.py .........xx........                               [ 65%]
tests/test_resolvers.py .....F...Job succeeded 

sdispater added a commit that referenced this issue Mar 21, 2019
@sdispater
Copy link
Member

This issue with the publish command should be fixed in commit 9035140. It will be released in the next bugfix version.

@sdispater
Copy link
Member

Version 0.12.12 has just been released!

@sztomi sztomi mentioned this issue Jul 28, 2019
3 tasks
@Erawpalassalg
Copy link

Erawpalassalg commented Jan 10, 2020

This bug seems to still be here

>>> subprocess.check_output('poetry --version', shell=True).decode()
'Poetry version 1.0.0\n'
>>> subprocess.check_call('poetry publish -r test-pypi --username erawpalassalg --password PASSWORD', shell=True)

Publishing bli (0.1.0) to test-pypi
 - Uploading bli-0.1.0-py3-none-any.whl 100%
 - Uploading bli-0.1.0.tar.gz 100%
0

using the -v flag doesn't help:

>>> subprocess.check_call('poetry publish -v -r test-pypi --username erawpalassalg --password PASSWORD', shell=True)

Publishing bli (0.1.0) to test-pypi
 - Uploading bli-0.1.0-py3-none-any.whl 100%
 - Uploading bli-0.1.0.tar.gz 100%
0

@rochacbruno
Copy link

I am experiencing the bug in Poetry 1.0.3

@finswimmer finswimmer reopened this Feb 22, 2020
@brentspector
Copy link

While uploading to TestPypi, poetry publish showed that it successfully uploaded, but I was unable to find it on the site. It turns out that it was getting a 301 because I missed the trailing / that it needed. Using -vvv did not return any helpful information for troubleshooting. I recommend the following.

  1. Output the attempted URL (or offer a way to output what the target repository's registered URL is during upload)
  2. Follow 301 automatically (offer a toggle if this is undesired) or output an error stating the location of the redirection.
  3. Don't show success when it never reached the target repository. This one might be tricky because of the various ways a private repo might handle publish requests.

@VikashKothary VikashKothary mentioned this issue Mar 12, 2020
3 tasks
@stefsmeets
Copy link

Thanks @brentspector, adding the trailing slash in the config works for me.

Using this fails silently:

poetry config repositories.testpypi https://test.pypi.org/legacy
poetry publish -r testpypi

Adding the slash works, and the package becomes available on testpypi:

poetry config repositories.testpypi https://test.pypi.org/legacy/
poetry publish -r testpypi

In both cases the output is identical.

@captn3m0
Copy link

I think the doc should use https://test.pypi.org/simple/ instead of https://foo.bar/simple/ which feels like a fake URL.

@mconigliaro
Copy link

mconigliaro commented May 21, 2022

When I use poetry config repositories.testpypi https://test.pypi.org/simple/ I get HTTP Error 405: Method Not Allowed, but when I use poetry config repositories.testpypi https://test.pypi.org/legacy/, it uploads fine. 🤔

@neersighted
Copy link
Member

Going to close and duplicate this onto #6687 as more discussion has happened there.

@neersighted neersighted closed this as not planned Won't fix, can't repro, duplicate, stale Oct 5, 2022
@neersighted neersighted removed kind/bug Something isn't working as expected area/publishing Related to PyPI/PEP 503 publishing labels Oct 5, 2022
@neersighted neersighted added the status/duplicate Duplicate issues label Oct 5, 2022
Copy link

github-actions bot commented Mar 1, 2024

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status/duplicate Duplicate issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.