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.

Poetry ignoring credentials in source url?

See original GitHub issue

Discussed in https://github.com/orgs/python-poetry/discussions/6629

<div type='discussions-op-text'>

Originally posted by keriksson-rosenqvist September 26, 2022 I am trying to set up a poetry environment which pulls a certain package from a private pypi-like registry. As I am sharing the project with others via a git repository, I want the setup to be contained within the pyproject.toml file, i.e. not rely on configs, environment variables, or keyring settings that may differ between user devices. I have therefore added a source with the basic http credentials included in the url. The exact same url is able to install the package and it’s dependencies through pip install -i https://<username:password>@[REDACTED]/pypi/simple/ my-private-package

[tool.poetry.dependencies]
my-private-package = { version = "^2.0.0", source = "my_private_package"}
...
[[tool.poetry.source]]
name = "my_private_package"
url = "https://<username:password>@[REDACTED]/pypi/simple/"
secondary = true

I’ve set secondary = true as that lets dependencies be installed from the normal pypi, otherwise poetry also fails to install them.

According to this issue, others have been seemingly been able to get it working with the credentials in the url, however with the setup above raises the following error for me.

$ poetry update
Updating dependencies
Resolving dependencies... (1.7s)

401 Client Error:  for url: https://[REDACTED]/pypi/download/my-private-package/2/my_private_package-2.0.0-py3-none-any.whl#sha256=[REDACTED]

Is this a bug, am I setting it up wrong, or has there been a change to the usage since the mentioned issue was able to get it to work?</div>

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:13 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
squirrel532commented, Nov 1, 2022

I’m facing similar problem which happened on a self-host GitLab PyPI repo too.

On version 1.2.2, poetry lock failed, but it works on version 1.1.15.

1reaction
kristangcommented, Oct 19, 2022

Arh, sorry I completely skipped that.

(Off-topic and sidenote: I would be careful about storing your credentials like that in your git)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Announcing Poetry 1.2.0 | Blog
Support for Direct Origin URL records (PEP 610) #. Poetry now supports reading and writing PEP 610 records, which resolves edge cases and ......
Read more >
Poetry: Dependency Management for Python - PyPI
This will set the url for repository foo to https://foo.bar/simple/ . If you want to store your credentials for a specific repository, you...
Read more >
python poetry installing from private repo using pyproject.toml ...
pip instal package1 --index-url "url" i am able to install using pip but not through poetry. I will check again must have missed...
Read more >
PyPI Repositories - JFrog - JFrog Documentation
Credentials can be supplied as part of the URL, for example http://<username>:<password>@localhost:8081/artifactory/api/pypi/pypi-local/simple .
Read more >
Dependency Scanning - GitLab Docs
Support for Poetry projects with a poetry.lock file was added in GitLab 15.0. ... then the version of Gradle pre-installed in the analyzer...
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