Skip to content

fails to install from git repo when commit doesn't belong to a branch #5002

@DetachHead

Description

@DetachHead
  • 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).

Issue

https://github.com/KotlinIsland/basedtyping/runs/4741756977?check_suite_focus=true

  Stack trace:

  8  ~\.local\pipx\venvs\poetry\lib\site-packages\poetry\installation\executor.py:203 in _execute_operation
      201│ 
      202│             try:
    → 203│                 result = self._do_execute_operation(operation)
      204│             except EnvCommandError as e:
      205│                 if e.e.returncode == -2:

  7  ~\.local\pipx\venvs\poetry\lib\site-packages\poetry\installation\executor.py:277 in _do_execute_operation
      275│             return 0
      276│ 
    → 277│         result = getattr(self, "_execute_{}".format(method))(operation)
      278│
      279│         if result != 0:

  6  ~\.local\pipx\venvs\poetry\lib\site-packages\poetry\installation\executor.py:412 in _execute_install
      410│ 
      411│     def _execute_install(self, operation):  # type: (Install) -> None
    → 412│         return self._install(operation)
      413│
      414│     def _execute_update(self, operation):  # type: (Update) -> None

  5  ~\.local\pipx\venvs\poetry\lib\site-packages\poetry\installation\executor.py:431 in _install
      429│ 
      430│         if package.source_type == "git":
    → 431│             return self._install_git(operation)
      432│
      433│         if package.source_type == "file":

  4  ~\.local\pipx\venvs\poetry\lib\site-packages\poetry\installation\executor.py:576 in _install_git
      574│             reference = package.source_reference
      575│ 
    → 576│         git.checkout(reference, src_dir)
      577│
      578│         # Now we just need to install from the source directory

  3  ~\.local\pipx\venvs\poetry\lib\site-packages\poetry\core\vcs\git.py:281 in checkout
      279│         args += ["checkout", rev]
      280│
    → 281│         return self.run(*args)
      282│
      283│     def rev_parse(self, rev, folder=None):  # type: (str, Optional[Path]) -> str

  2  ~\.local\pipx\venvs\poetry\lib\site-packages\poetry\core\vcs\git.py:356 in run
      354│ 
      355│         return decode(
    → 356│             subprocess.check_output(
      357│                 [executable()] + list(args), stderr=subprocess.STDOUT
      358│             )

  1  ~\AppData\Local\Programs\Python\Python310\lib\subprocess.py:420 in check_output
       418│         kwargs['input'] = empty
       419│ 
    →  420│     return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
       421│                **kwargs).stdout
       422│

  CalledProcessError

  Command '['C:\\Program Files\\Git\\cmd\\git.exe', '--git-dir', 'C:/Users/user/basedtyping/.venv/src/basedmypy/.git', '--work-tree', 'C:/Users/user/basedtyping/.venv/src/basedmypy', 'checkout', 'e5d40fc37d8d6eca75d8784020d82b4574b042b7']' returned non-zero exit status 128.

  at ~\.local\pipx\venvs\poetry\lib\site-packages\poetry\utils\_compat.py:217 in run
      213│                 process.wait()
      214│                 raise
      215│             retcode = process.poll()
      216│             if check and retcode:
    → 217│                 raise CalledProcessError(
      218│                     retcode, process.args, output=stdout, stderr=stderr
      219│                 )
      220│         finally:
      221│             # None because our context manager __exit__ does not use them.

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