Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git branch depencies and force-push #5105

Closed
3 tasks done
jeremad opened this issue Jan 26, 2022 · 4 comments · Fixed by #5428
Closed
3 tasks done

git branch depencies and force-push #5105

jeremad opened this issue Jan 26, 2022 · 4 comments · Fixed by #5428
Labels
kind/bug Something isn't working as expected

Comments

@jeremad
Copy link

jeremad commented Jan 26, 2022

  • 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

I use poetry with a git dependency on a particular branch:

foo = { git = "https://github.com/bar/foo.git", branch = "feat/branch" }

I run poetry update and I have my lock file, with the commit sha of this particular branch at this particular time.

Now I force push my branch feat/branch and I try running poetry install, I have the following error:

CalledProcessError

  Command '['git', '--git-dir', '.../.cache/pypoetry/virtualenvs/poetry-bug-MXzYaQCP-py3.8/src/foo/.git', '--work-tree', '.../.cache/pypoetry/virtualenvs/poetry-bug-MXzYaQCP-py3.8/src/foo', 'checkout', '99eeaa1910a597818b134319db5641cd61d27978']' returned non-zero exit status 128.

  at ~/.poetry/lib/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.

This is because the commit sha of the poetry.lock file does not exist anymore (or is not in a branch at least).

I would like this use-case to be valid, without having to run poetry update every time my branch changes. This is perhaps more of a feature request than a bug report. I understand that the current behavior is also valid. Could it be an option in the configuration not to write the commit sha in the lock file?

This is related to this issue: #5002 AFAICT

Thank you all for the awesome work,
regards

@jeremad jeremad added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Jan 26, 2022
@abn
Copy link
Member

abn commented Apr 8, 2022

@jeremad can you verify if #5428 fixes this issue?

@jeremad
Copy link
Author

jeremad commented Apr 13, 2022

Sure thing!

@abn
Copy link
Member

abn commented May 2, 2022

Resolved-by: #5428
Related: #5002

@abn abn closed this as completed May 2, 2022
@mkniewallner mkniewallner removed the status/triage This issue needs to be triaged label Jun 11, 2022
Copy link

github-actions bot commented Mar 1, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants