python-poetry / python-poetry/poetry

Repository "private" does not exist | Since 1.1.0

Open
#3,114 20 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area/repo kind/bug status/triage
Dominant language
Python
Stars
34.3k
Forks
2.5k
Avg merge
2d 19h
Merged PRs (30d)
30

Description

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

Issue

When running a poetry install with a private repo (poetry config http-basic.private is set correctly), I get:

  Stack trace:

  7  /usr/local/lib/python3.7/site-packages/poetry/installation/executor.py:199 in _execute_operation
      197│
      198│             try:
    → 199│                 result = self._do_execute_operation(operation)
      200│             except EnvCommandError as e:
      201│                 if e.e.returncode == -2:

  6  /usr/local/lib/python3.7/site-packages/poetry/installation/executor.py:273 in _do_execute_operation
      271│             return 0
      272│
    → 273│         result = getattr(self, "_execute_{}".format(method))(operation)
      274│
      275│         if result != 0:

  5  /usr/local/lib/python3.7/site-packages/poetry/installation/executor.py:408 in _execute_install
      406│
      407│     def _execute_install(self, operation):  # type: (Install) -> None
    → 408│         return self._install(operation)
      409│
      410│     def _execute_update(self, operation):  # type: (Update) -> None

  4  /usr/local/lib/python3.7/site-packages/poetry/installation/executor.py:434 in _install
      432│             archive = self._download_link(operation, Link(package.source_url))
      433│         else:
    → 434│             archive = self._download(operation)
      435│
      436│         operation_message = self.get_operation_message(operation)

  3  /usr/local/lib/python3.7/site-packages/poetry/installation/executor.py:575 in _download
      573│
      574│     def _download(self, operation):  # type: (Operation) -> Path
    → 575│         link = self._chooser.choose_for(operation.package)
      576│
      577│         return self._download_link(operation, link)

  2  /usr/local/lib/python3.7/site-packages/poetry/installation/chooser.py:60 in choose_for
       58│         """
       59│         links = []
    →  60│         for link in self._get_links(package):
       61│             if link.is_wheel and not Wheel(link.filename).is_supported_by_environment(
       62│                 self._env

  1  /usr/local/lib/python3.7/site-packages/poetry/installation/chooser.py:92 in _get_links
       90│                 repository = self._pool.repository("pypi")
       91│         else:
    →  92│             repository = self._pool.repository(package.source_reference)
       93│
       94│         links = repository.find_links_for_package(package)

  ValueError

  Repository "private" does not exist.

  at /usr/local/lib/python3.7/site-packages/poetry/repositories/pool.py:53 in repository
       49│
       50│         if name in self._lookup:
       51│             return self._repositories[self._lookup[name]]
       52│
    →  53│         raise ValueError('Repository "{}" does not exist.'.format(name))
       54│
       55│     def add_repository(
       56│         self, repository, default=False, secondary=False
       57│     ):  # type: (Repository, bool, bool) -> Pool

If I downgrade to 1.0.10, everything works fine. This error popped at the 1.1.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the private-source install with the shown pyproject.toml and -vvv, then start in poetry/installation/chooser.py and poetry/repositories/pool.py, following the call from _get_links to repository(). Compare the 1.1.x behavior with 1.0.10. Done means a configured private repository is found and poetry install completes without the "Repository "private" does not exist" error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.