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

poetry 1.1 fails to publish to artifactory (1.0.x was working) #3052

Closed
3 tasks done
voegtlel opened this issue Oct 2, 2020 · 4 comments · Fixed by #3080
Closed
3 tasks done

poetry 1.1 fails to publish to artifactory (1.0.x was working) #3052

voegtlel opened this issue Oct 2, 2020 · 4 comments · Fixed by #3080
Labels
kind/bug Something isn't working as expected

Comments

@voegtlel
Copy link

voegtlel commented Oct 2, 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).
  • OS version and name: Ubuntu 18.04
  • Poetry version: 1.1.0
  • Link of a Gist with the contents of your pyproject.toml file:
[tool.poetry]
name = "mypackage"
version = "0.3dev23"
description = "MyPackage"

[tool.poetry.dependencies]
python = "^3.7"

[[tool.poetry.source]]
name = "artifactory"
url = "http://myartifactory/artifactory/api/pypi/pypi/simple"
default = true

[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"

Issue

Hi there, since the update to 1.1.0, (CI/CD) deployment to artifactory fails with the error

> export POETRY_HTTP_BASIC_ARTIFACTORY_USERNAME=mydeploymentuser
> export POETRY_HTTP_BASIC_ARTIFACTORY_PASSWORD=mydeploymentpassword
> poetry config repositories.artifactory "https://myartifactory/artifactory/api/pypi/my-py-local"
> poetry publish -vvv --repository artifactory

No suitable keyring backends were found
Using a plaintext file to store and retrieve credentials
Publishing mypackage (0.3dev23) to artifactory
 - Uploading mypackage-0.3.dev23-py3-none-any.whl 100%

  UploadError

  HTTP Error 415: Unsupported Media Type

  at /usr/local/lib/python3.7/site-packages/poetry/publishing/uploader.py:216 in _upload
      212│                     self._register(session, url)
      213│                 except HTTPError as e:
      214│                     raise UploadError(e)
      215│
    → 216│             raise UploadError(e)
      217│
      218│     def _do_upload(
      219│         self, session, url, dry_run=False
      220│     ):  # type: (requests.Session, str, Optional[bool]) -> None

If I revert to 1.0.10, it succeeds without error:

> pip install poetry==1.0.10
> poetry publish -vvv --repository artifactory

Publishing mypackage (0.3dev23) to artifactory
No suitable keyring backends were found
Using a plaintext file to store and retrieve credentials
 - Uploading mypackage-0.3.dev23-py3-none-any.whl 100%
 - Uploading mypackage-0.3.dev23.tar.gz 100%

I hope that suffices for checking the errors.

Thanks!

@voegtlel voegtlel added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Oct 2, 2020
@rudolfsberzins
Copy link

It seems we have the same issue - #3053

@voegtlel voegtlel changed the title poetry 1.1 fails to publish to artifactory (1.0.x was woking) poetry 1.1 fails to publish to artifactory (1.0.x was working) Oct 2, 2020
@abn
Copy link
Member

abn commented Oct 2, 2020

The issue is caused because package.sources defined in the pyproject taking precedence over poetry config repositories values.

Workaround until 1.1.1 is to do the following. Note the suffix added to the repository names.

poetry config repositories.artifactory-upload "https://myartifactory/artifactory/api/pypi/my-py-local"
poetry publish -r artifactory-upload

@colindean
Copy link
Contributor

This has crept back up. I'm on Poetry 1.1.8 on Python 3.7 and trying to push to Artifactory. Adding the -upload workaround worked for me.

Copy link

github-actions bot commented Mar 2, 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 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants