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:
- Created 3 years ago
- Reactions:40
- Comments:35 (13 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Why this issue is closed? It seems like the fix has not been pushed
I had the same issue, it works for me when I do the following steps:
pyproject.toml
remove the wordsimple
from the url in[[tool.poetry.source]]
poetry config repositories <REPOSITORY_NAME> <URL>
where url is the same one that you set in[[tool.poetry.source]]
(without the word simple)