Skip to content

poetry 1.2.0a1: AttributeError when installing package from secondary repo #4085

@maksbotan

Description

@maksbotan
  • 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

  • Poetry version: 1.2.0a1

  • Link of a Gist with the contents of your pyproject.toml file:

Issue

Hi! I'm testing new 1.2.0a1 version as an early-adopter to find potential issues.

My pyproject.toml defines a secondary repo:

[[tool.poetry.source]]
name = "XXX"
url = "https://pypi.XXX.YYY"
secondary = true

And I have one dependency which comes from this private pypi repo. Poetry 1.1.3 installed it without errors, but on 1.2.0a1 I get this stacktrace:

  • Installing FOOBAR (1.7.2): Pending...
  • Installing FOOBAR (1.7.2): Failed

  Stack trace:

  5  ~/Library/Application Support/pypoetry/venv/lib/python3.8/site-packages/poetry/installation/executor.py:244 in _execute_operation
      242│ 
      243│             try:
    → 244│                 result = self._do_execute_operation(operation)
      245│             except EnvCommandError as e:
      246│                 if e.e.returncode == -2:

  4  ~/Library/Application Support/pypoetry/venv/lib/python3.8/site-packages/poetry/installation/executor.py:321 in _do_execute_operation
      319│             return 0
      320│ 
    → 321│         result = getattr(self, f"_execute_{method}")(operation)
      322│ 
      323│         if result != 0:

  3  ~/Library/Application Support/pypoetry/venv/lib/python3.8/site-packages/poetry/installation/executor.py:462 in _execute_install
      460│ 
      461│     def _execute_install(self, operation: Union[Install, Update]) -> int:
    → 462│         status_code = self._install(operation)
      463│ 
      464│         self._save_url_reference(operation)

  2  ~/Library/Application Support/pypoetry/venv/lib/python3.8/site-packages/poetry/installation/executor.py:498 in _install
      496│             archive = self._download_link(operation, Link(package.source_url))
      497│         else:
    → 498│             archive = self._download(operation)
      499│ 
      500│         operation_message = self.get_operation_message(operation)

  1  ~/Library/Application Support/pypoetry/venv/lib/python3.8/site-packages/poetry/installation/executor.py:648 in _download
      646│         link = self._chooser.choose_for(operation.package)
      647│ 
    → 648│         return self._download_link(operation, link)
      649│ 
      650│     def _download_link(self, operation: Union[Install, Update], link: Link) -> Link:

  AttributeError

  'Link' object has no attribute 'name'

  at ~/Library/Application Support/pypoetry/venv/lib/python3.8/site-packages/poetry/installation/executor.py:683 in _download_link
      679│                 ).hash()
      680│             )
      681│             if archive_hash not in {f["hash"] for f in package.files}:
      682│                 raise RuntimeError(
    → 683│                     f"Invalid hash for {package} using archive {archive.name}"
      684│                 )
      685│ 
      686│             self._hashes[package.name] = archive_hash
      687│ 

If you need any additional info to better understand the issue, I'll be happy to provide it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working as expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions