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

publish command doesn't publish to PyPI despite showing no errors #3397

Open
3 tasks done
xdb64 opened this issue Nov 21, 2020 · 2 comments
Open
3 tasks done

publish command doesn't publish to PyPI despite showing no errors #3397

xdb64 opened this issue Nov 21, 2020 · 2 comments
Labels
area/publishing Related to PyPI/PEP 503 publishing kind/bug Something isn't working as expected status/triage This issue needs to be triaged

Comments

@xdb64
Copy link

xdb64 commented Nov 21, 2020

  • 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).
  • Linux 5.4.0-53-generic XUbuntu 20.04 x86_64 GNU/Linux:
  • Poetry version 1.1.4:
  • Link of a Gist with the contents of your pyproject.toml file:

Issue

I have an issue with poetry not publishing the package to PyPI. The project is called dpaster, however the PyPI repo name is called thepaster. I've configured it to point to the remote repository:

The output of config command:

$ poetry config --list
cache-dir = "/home/alex/.cache/pypoetry"
experimental.new-installer = true
installer.parallel = true
repositories.dpaster.url = "https://pypi.org/project/thepaster"
virtualenvs.create = true
virtualenvs.in-project = null
virtualenvs.path = "{cache-dir}/virtualenvs"  # /home/alex/.cache/pypoetry/virtualenvs

The output of publish command:

$ poetry publish -r dpaster -vvv

Username: adder46
Password: 
Publishing dpaster (3.2.2) to dpaster
 - Uploading dpaster-3.2.2-py3-none-any.whl 100%
 - Uploading dpaster-3.2.2.tar.gz 100%

As you can see, it doesn't report any error, however, the project ends up not getting published.
I realize it works when the name in pyproject.toml is the same as the remote repository repo name, but IMO this should throw an error if it's not getting published.

@xdb64 xdb64 added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Nov 21, 2020
@finswimmer finswimmer added the area/publishing Related to PyPI/PEP 503 publishing label Nov 27, 2020
@dusktreader
Copy link
Contributor

dusktreader commented Dec 4, 2020

I can confirm the same behavior when attempting to publish to a gitlab pypi clone.

Trying the same publishing sequence with twine showed that the upload of the files was successful, but registering the new versions was getting rejected by a 403 error due to permissions.

Publishing with twine:

$ python -m twine upload --repository gitlab dist/* --verbose                                                                                                                                                                                   
Uploading distributions to https:/---.com/api/v4/projects/1330/packages/pypi
  dist/fetch_config-0.1.4-py3-none-any.whl (3.8 KB)
  dist/fetch_config-0.1.5-py3-none-any.whl (3.8 KB)
  dist/fetch_config-0.4.4-py3-none-any.whl (4.2 KB)
  dist/fetch_config-0.4.5-py3-none-any.whl (4.2 KB)
  dist/fetch_config-0.4.6-py3-none-any.whl (5.5 KB)
  dist/fetch_config-0.4.7-py3-none-any.whl (5.5 KB)
  dist/fetch_config-0.4.8-py3-none-any.whl (5.5 KB)
  dist/fetch-config-0.1.4.tar.gz (3.3 KB)
  dist/fetch-config-0.1.5.tar.gz (3.4 KB)
  dist/fetch-config-0.4.4.tar.gz (3.8 KB)
  dist/fetch-config-0.4.5.tar.gz (3.8 KB)
  dist/fetch-config-0.4.6.tar.gz (4.6 KB)
  dist/fetch-config-0.4.7.tar.gz (4.6 KB)
  dist/fetch-config-0.4.8.tar.gz (4.6 KB)
Uploading fetch_config-0.1.4-py3-none-any.whl
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 7.33k/7.33k [00:00<00:00, 109kB/s]
Content received from server:
{"message":"403 Forbidden"}
HTTPError: 403 Forbidden from https:/---.com/api/v4/projects/1330/packages/pypi
Forbidden       

publishing with poetry:

$ poetry publish --repository=gitlab

Publishing fetch-config (0.4.8) to gitlab
URL: http://---.com/api/v4/projects/1214/packages/pypi
 - Uploading fetch-config-0.4.8.tar.gz 100%
URL: http://---.com/api/v4/projects/1214/packages/pypi
 - Uploading fetch_config-0.4.8-py3-none-any.whl 100%

$ echo $?                                                                                                                                                                                                                                       
0

Even though the package wasn't registered, the command exited with a success code. Once I resolved the permissions issue, both the twine and the poetry publish command successfully published the package

hauntsaninja added a commit to hauntsaninja/poetry that referenced this issue Jan 7, 2021
Should help with cases like python-poetry#3397

The existing tests in tests/publishing/test_uploader.py should verify
that this doesn't cause regressions.
hauntsaninja added a commit to hauntsaninja/poetry that referenced this issue Jan 7, 2021
Should help with cases like python-poetry#3397

The existing tests in tests/publishing/test_uploader.py should verify
that this doesn't cause regressions.
neersighted pushed a commit to hauntsaninja/poetry that referenced this issue Nov 14, 2021
Should help with cases like python-poetry#3397

The existing tests in tests/publishing/test_uploader.py should verify
that this doesn't cause regressions.
neersighted pushed a commit that referenced this issue Nov 14, 2021
Should help with cases like #3397

The existing tests in tests/publishing/test_uploader.py should verify
that this doesn't cause regressions.
1nF0rmed pushed a commit to 1nF0rmed/poetry that referenced this issue Nov 15, 2021
Should help with cases like python-poetry#3397

The existing tests in tests/publishing/test_uploader.py should verify
that this doesn't cause regressions.
edvardm pushed a commit to edvardm/poetry that referenced this issue Nov 24, 2021
Should help with cases like python-poetry#3397

The existing tests in tests/publishing/test_uploader.py should verify
that this doesn't cause regressions.
@bashirmindee
Copy link

by using poetry v1.2.2, at least I get an error
HTTP Error 405: Method Not Allowed | b'<html>\n <head>\n <title>405 Method Not Allowed\n \n <body>\n <h1>405 Method Not Allowed\n The method POST is not allowed for this resource. <br/><br/>\n\n \n'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/publishing Related to PyPI/PEP 503 publishing kind/bug Something isn't working as expected status/triage This issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

4 participants