question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use separate “publish” URL for a private PyPI feed

See original GitHub issue
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have searched the documentation and believe that my question is not covered.

Feature Request

We currently use Azure DevOps Artifacts and it uses two different URLs, I feel this is similar to Artifactory and other feeds.

For pulling packages, the familiar https://.../.../pypi/simple index URL is used, but for submitting packages, https://.../.../pypi/upload Is used.

I am not aware if this is common for PyPI feeds or not, it would be great if poetry could auto-detect this and use the correct URL, or at least provide a mechanism to specify a separate publish URL for the same feed.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
jtratnercommented, May 26, 2020

Gotcha, that’s a really helpful explanation! maybe there’s space for a --repository-url In addition to repository?

On Tue, May 26, 2020 at 02:28 xM8WVqaG notifications@github.com wrote:

(not OP but same issue)

I’m not able to pass the URL in under the --repository flag. I have to define the repo first.

[]$ poetry --version Poetry version 1.0.5

[]$ poetry publish -n --build
–repository https://gitlab.com/api/v4/projects/{REPO_ID}/packages/pypi
-u token
-p REDACTED Building my_package (0.1.4)

  • Building sdist

  • Built my_package-0.1.4.tar.gz

  • Building wheel

  • Built my_package-0.1.4-py3-none-any.whl

Publishing my_package (0.1.4) to https://gitlab.com/api/v4/projects/{REPO_ID}/packages/pypi

[RuntimeError] Repository https://gitlab.com/api/v4/projects/{REPO_ID}/packages/pypi is not defined

On the CI I’m doing:

Automatically creating this is fine to do in a CI lifecycle that’s destroyed after but would be inappropriate to do on a local environment. We were already discouraging manually publishing builds so I’ve been pretending this is a feature!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/python-poetry/poetry/issues/2291#issuecomment-633915541, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMGHK2KO74JMUFHQ5TRE5DRTODVJANCNFSM4MF3F5YA .

2reactions
xM8WVqaGcommented, May 26, 2020

(not OP but same issue)

I’m not able to pass the URL in under the --repository flag. I have to define the repo first.

[]$ poetry --version
Poetry version 1.0.5

[]$ poetry publish -n --build \
      --repository https://gitlab.com/api/v4/projects/{REPO_ID}/packages/pypi \
      -u __token__ \
      -p REDACTED                                    
Building my_package (0.1.4)
 - Building sdist
 - Built my_package-0.1.4.tar.gz

 - Building wheel
 - Built my_package-0.1.4-py3-none-any.whl

Publishing my_package (0.1.4) to https://gitlab.com/api/v4/projects/{REPO_ID}/packages/pypi

[RuntimeError]
Repository https://gitlab.com/api/v4/projects/{REPO_ID}/packages/pypi is not defined

On the CI I’m doing:

- poetry config repositories.this "https://gitlab.com/api/v4/projects/{REPO_ID}/packages/pypi"
- >
  poetry publish -n --build
  -r this
  -u $POETRY_HTTP_BASIC_GITLAB_USERNAME
  -p $POETRY_HTTP_BASIC_GITLAB_PASSWORD

Automatically creating this is fine to do in a CI lifecycle that’s destroyed after but would be inappropriate to do on a local environment. We were already discouraging manually publishing builds so I’ve been pretending this is a feature!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Repositories | Documentation | Poetry - Python dependency ...
Poetry treats repositories to which you publish packages as user specific and not project specific configuration unlike package sources. Poetry, today, only ...
Read more >
How to Publish an Open-Source Python Package to PyPI
In this step-by-step tutorial, you'll learn how to create a Python package for your project and how to publish it to PyPI, the...
Read more >
pip: prioritize a private pypi server - python - Stack Overflow
pip devs have stated that all package indexes always have equal priority, ... the other index decides to publish a package under that...
Read more >
Hosting private pip packages using Azure Artifacts
Hosting private pip packages using Azure Artifacts ... Finally, Publish new package needs to contain the following script: python setup.py ...
Read more >
Publish python package into private repository behind VPN
I have ended up using answer from comments. my strategy would be to create a source code release zip file and publish it...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found