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

Private PyPi URL for publishing and downloading is not the same #4658

Open
1 task done
tropxy opened this issue Oct 19, 2021 · 2 comments
Open
1 task done

Private PyPi URL for publishing and downloading is not the same #4658

tropxy opened this issue Oct 19, 2021 · 2 comments
Labels
area/docs Documentation issues/improvements status/triage This issue needs to be triaged

Comments

@tropxy
Copy link

tropxy commented Oct 19, 2021

  • I have searched the issues of this repo and believe that this is not a duplicate.

Issue

Hi,

First thank you for your effort on this library.
I have been trying to add a dependency from a private pypi repo and I followed the docs and other internet resources to be able to download and upload the package from/to my private PyPi server. However, after some experiments, I realised that the download and upload just worked using different URLs.

For downloading I used the following configuration in pyproject.toml, which follows Poetry docs:

[[tool.poetry.source]]
name = "foo_api"
url = "https://pypi.foo.com/simple/"

And it works perfectly.

However, for uploading I had to use a different URL:

$ poetry config repo.foo_api https://pypi.foo.com/
$ poetry publish -r foo_api

which is not what is recommended in the docs [1]

If I use the recommendation from the Docs, then I get the following:

Publishing foo_api (0.1.0) to mqtt_api
 - Uploading foo_api-0.1.0-py3-none-any.whl 100%

  UploadError

  HTTP Error 405: Method Not Allowed

  at ~/.virtualenvs/foo_api/lib/python3.10/site-packages/poetry/publishing/uploader.py:216 in _upload
      212self._register(session, url)
      213except HTTPError as e:
      214raise UploadError(e)
      215│
    → 216raise UploadError(e)
      217218def _do_upload(
      219self, session, url, dry_run=False
      220│     ):  # type: (requests.Session, str, Optional[bool]) -> None
make: *** [deploy] Error 1

Seems I was not the first tumbling into this issue, as I found a similar one in stackoverflow:
https://stackoverflow.com/questions/65064910/cant-upload-poetry-package-to-local-dockerized-pypiserver

Installation details
Poetry version 1.1.11
Python version 3.10
20.6.0 Darwin Kernel Version 20.6.0: Mon Aug 30 06:12:21 PDT 2021; root:xnu-7195.141.6~3/RELEASE_X86_64 x86_64

@tropxy tropxy added area/docs Documentation issues/improvements status/triage This issue needs to be triaged labels Oct 19, 2021
@FilBot3
Copy link

FilBot3 commented Mar 23, 2022

Similar to Issue: #5348

@abn
Copy link
Member

abn commented Mar 29, 2022

@tropxy I suspect you need to identify what upload endpoint to use.

Poetry distinguishes between sources and repositories for publishing. You are on the correct track, however I suspect https://pypi.foo.com/ does not accept uploads, the upload url might look like https://upload.pypi.org/legacy/ (Warehouse), https://pkgs.dev.azure.com/<your-organization-name>/<your-project-name>/_packaging/<your-feed-name>/pypi/upload (Azure DevOps) etc. Might need to chck what your index deployment uses.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/docs Documentation issues/improvements status/triage This issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

3 participants