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.

Authentication from poetry.toml doesn't work on 1.1.x

See original GitHub issue
  • 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: MacOS 10.15.7

  • Poetry version: 1.1.3

Issue

After upgrade from 1.0.10 to 1.1.3 the authentication for private repositories doesn’t work.

I have an file poetry.toml with this content:

[repositories]
[repositories.MyPrivateFeed]
url = "https://my-private-repo/pypi/simple/"

[http-basic]
[http-basic.MyPrivateFeed]
username = "user"
password = "pass"

And on pyproject.toml

  [[tool.poetry.source]]
  name = "MyPrivateFeed"
  url = "https://my-private-repo/pypi/simple/"
  secondary = true

When I try to update/lock/install I get an error:

update

poetry update

Updating dependencies
Resolving dependencies... (0.4s)

  RepositoryError

  401 Client Error: Unauthorized for url: https://my-private-repo/pypi/simple/mypy/

  at ~/.pyenv/versions/3.8.5/envs/my-project/lib/python3.8/site-packages/poetry/repositories/legacy_repository.py:390 in _get
      386│             if response.status_code == 404:
      387│                 return
      388│             response.raise_for_status()
      389│         except requests.HTTPError as e:
    → 390│             raise RepositoryError(e)
      391│
      392│         if response.status_code in (401, 403):
      393│             self._log(
      394│                 "Authorization error accessing {url}".format(url=url), level="warn"

lock

poetry lock

Updating dependencies
Resolving dependencies... (0.4s)

  RepositoryError

  401 Client Error: Unauthorized for url: https://my-private-repo/pypi/simple/mypy/

  at ~/.pyenv/versions/3.8.5/envs/my-project/lib/python3.8/site-packages/poetry/repositories/legacy_repository.py:390 in _get
      386│             if response.status_code == 404:
      387│                 return
      388│             response.raise_for_status()
      389│         except requests.HTTPError as e:
    → 390│             raise RepositoryError(e)
      391│
      392│         if response.status_code in (401, 403):
      393│             self._log(
      394│                 "Authorization error accessing {url}".format(url=url), level="warn"

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:40
  • Comments:35 (13 by maintainers)

github_iconTop GitHub Comments

11reactions
alchemistakecommented, Nov 15, 2021

Why this issue is closed? It seems like the fix has not been pushed

8reactions
ayalganem55commented, Nov 16, 2020

I had the same issue, it works for me when I do the following steps:

  1. In the file pyproject.toml remove the word simple from the url in [[tool.poetry.source]]
  2. make sure that you run poetry config repositories <REPOSITORY_NAME> <URL> where url is the same one that you set in [[tool.poetry.source]] (without the word simple)
Read more comments on GitHub >

github_iconTop Results From Across the Web

Authentication from poetry.toml doesn't work on 1.1.x
[x] I am on the latest Poetry version. [x] I have searched the issues of this repo and believe that this is not...
Read more >
Announcing Poetry 1.2.0 | Blog
The Poetry team is pleased to announce the immediate availability of Poetry 1.2.0. Poetry 1.2 boasts a massive list of changes, new features ......
Read more >
python - Poetry trying to install everything from private repository
So far I have tried to: explicitly set the source for each dependency in the pyproject. toml file (e.g: mypy = {version =...
Read more >
Dependency Scanning - GitLab Docs
If you use your own runners, make sure your installed version of Docker is not 19.03.0 . See troubleshooting information for details. Dependency...
Read more >
Configure a Poetry environment | PyCharm Documentation
Don't forget to replace jetbrains with your username! To verify the installation, run the following command: poetry --version.
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