-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
fails to install from git repo when commit doesn't belong to a branch #5002
Comments
This looks like more of the same, using poetry 1.2.0a2 here. Gist of the pyproject.toml: https://gist.github.com/synrg/3fb23744614b50da8f080f5c566846df Note that the Red-DiscordBot dependency, in turn, depends on a PR for Red-Lavalink. The git command poetry tries to execute fails, as it can't checkout this pull which has not yet been fetched: CalledProcessError
Command '['git', '--git-dir', '/tmp/pypoetry-git-Red-Lavalinkwr2dmj40/.git', '--work-tree', '/tmp/pypoetry-git-Red-Lavalinkwr2dmj40', 'checkout', 'refs/pull/99/merge']' returned non-zero exit status 1.
at /usr/local/lib/python3.9/subprocess.py:528 in run
524│ # We don't call process.wait() as .__exit__ does that for us.
525│ raise
526│ retcode = process.poll()
527│ if check and retcode:
→ 528│ raise CalledProcessError(retcode, process.args,
529│ output=stdout, stderr=stderr)
530│ return CompletedProcess(process.args, retcode, stdout, stderr)
531│
532│ i.e. |
@DetachHead @synrg can you verify if #5428 fixes this issue? |
Unfortunately I can't easily do that, due to the following circumstances:
Sorry about that. |
@abn Good news / bad news. With the help of a Red dev who recovered an older version of the branch: https://github.com/Kowlin/Red-DiscordBot/tree/V3/dpy2_unstable I was able to reproduce the issue using 1.2.0b1. Unfortunately, when using poetry from your use-dulwich branch, it breaks again, only this time with a slightly different error, an |
Here's the new gist for the |
Thanks @synrg this helps. I'll do some checking. |
@synrg Looks like the issue you encountered was caused by the dependency to Red-Lavalink as the branch nop longer exists. I have improved the error handling when that happens on my branch. $ poetry add git+https://github.com/Rapptz/discord.py#eca472759338d87ad616a44191b7a2ccf55bbabf
Creating virtualenv foobar in /tmp/foobar/.venv
Updating dependencies
Resolving dependencies... (0.1s)
Package operations: 10 installs, 0 updates, 0 removals
• Installing frozenlist (1.3.0)
• Installing idna (3.3)
• Installing multidict (6.0.2)
• Installing aiosignal (1.2.0)
• Installing async-timeout (4.0.2)
• Installing attrs (21.4.0)
• Installing charset-normalizer (2.0.12)
• Installing yarl (1.7.2)
• Installing aiohttp (3.8.1)
• Installing discord.py (2.0.0a3952+geca47275 eca4727)
$ poetry add git+https://github.com/Kowlin/Red-DiscordBot#V3/dpy2_unstable
Updating dependencies
Resolving dependencies... (0.6s)
Failed to clone 'dpy2_unstable' from https://github.com/Cog-Creators/Red-Lavalink |
Aha. That makes sense. So a more thorough test would've had to point at a PR that still exists, and that is expected to work? I wasn't aware that both the branch and the PR were now gone. If contriving such a second test would help, let me know and I'll see what can be done. |
I have updated our test to use this pyproject.toml which is a more complete restore of the Red-DiscordBot dpy2_unstable branch and the Red-Lavalink dpy2_unstable branch, and the PR on that branch (both the branch and the PR exist now): https://gist.github.com/synrg/61642721c91141b1377c056b8ddf100f Then I tried both on 1.2.0b1 (fails as it did before) and your updated use-dulwich branch, which I deleted locally and checked out again. Now it fails with this error:
Note that it's no longer failing on the branch, because it now exists. But it's not successfully cloning the PR, even though it exists now. |
So, turns out this is because poetry determins With the fix, seems things are happy. $ poetry add git+https://github.com/jack1142/Red-DiscordBot#branch_for_sb
Updating dependencies
Resolving dependencies... (47.3s)
Writing lock file
Package operations: 37 installs, 0 updates, 0 removals
• Installing idna (3.2)
• Installing multidict (5.1.0)
• Installing async-timeout (3.0.1)
• Installing attrs (21.2.0)
• Installing chardet (4.0.0)
• Installing typing-extensions (3.10.0.2)
• Installing yarl (1.6.3)
• Installing aiohttp (3.7.4.post0)
• Installing pycparser (2.20)
• Installing cffi (1.14.6)
• Installing colorama (0.4.4)
• Installing commonmark (0.9.1)
• Installing contextlib2 (21.6.0)
• Installing discord.py (2.0.0a3952+geca47275 3d914e0)
• Installing pygments (2.10.0)
• Installing pytz (2021.1)
• Installing red-commons (1.0.0)
• Installing six (1.16.0)
• Installing aiohttp-json-rpc (0.13.3)
• Installing aiosqlite (0.17.0)
• Installing appdirs (1.4.4)
• Installing apsw-wheels (3.36.0.post1)
• Installing babel (2.9.1)
• Installing click (8.0.1)
• Installing distro (1.6.0)
• Installing fuzzywuzzy (0.18.0)
• Installing markdown (3.3.4)
• Installing psutil (5.8.0)
• Installing pynacl (1.4.0)
• Installing python-dateutil (2.8.2)
• Installing python-levenshtein-wheels (0.13.2)
• Installing pyyaml (5.4.1)
• Installing red-lavalink (0.11.0rc0 94526e2)
• Installing rich (10.9.0)
• Installing schema (0.7.4)
• Installing uvloop (0.16.0)
• Installing red-discordbot (3.5.0.dev1 1e2a710) |
still getting the same error with #5428
|
@DetachHead looks like you installed the PR version but used your default poetry. [email protected] update |
my bad, i didnt realize that's what now i get this error
my [tool.poetry.dependencies]
basedtyping = { git = "https://github.com/KotlinIsland/basedtyping.git", rev = "7962a3380a906d3c1e17bec13461cb41e7ee2744" } |
excellent. i can confirm with those commits, my test case no longer fails, and all of the dependencies are successfully installed, including the PR for Red-Lavalink. thanks! |
@DetachHead I suspect that might be out of scope for us in general. As what you are seeing is a side-effect of github not running $ git clone https://github.com/KotlinIsland/basedtyping.git
Cloning into 'basedtyping'...
remote: Enumerating objects: 521, done.
remote: Counting objects: 100% (521/521), done.
remote: Compressing objects: 100% (315/315), done.
remote: Total 521 (delta 305), reused 400 (delta 193), pack-reused 0
Receiving objects: 100% (521/521), 102.83 KiB | 2.71 MiB/s, done.
Resolving deltas: 100% (305/305), done.
$ cd basedtyping/
$ git checkout 7962a3380a906d3c1e17bec13461cb41e7ee2744
fatal: reference is not a tree: 7962a3380a906d3c1e17bec13461cb41e7ee2744
$ git reflog
0b07cdf (HEAD -> master, origin/master, origin/HEAD) HEAD@{0}: clone: from https://github.com/KotlinIsland/basedtyping.git |
i know npm is able to install commits that don't belong to a branch, however i did notice the commit from my original post is gone so i suppose they do run i'm curious though as to how my scenatio is different to @abn and @synrg's? |
@DetachHead maybe a post merge branch that was not deleted? Or another branch existed off of it? I suspect there are a variety of possibilitie there unfortunately. |
Resolved-by: #5428 |
The problem still reproducible (for poetry 1.1.14) :
As workaround I use HEAD to avoid useless checkout here: |
@LVladymyr The linked PR is in 1.2 milestone so there was no stable release of poetry with the fix yet. It should not be reproducible in latest 1.2.0 beta release. |
I've faced the same issue with the following line:
It worked with poetry==1.3.2, but doesn't work with poetry=1.11.1, since.... drum roll.... the branch is named "main" and the old poetry by default use "master" branch. So it started working after I specified the commit:
I think error messages can be greatly improved to show the reason of a failure like "Couldn't checkout branch 'master'". |
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. |
-vvv
option).Issue
https://github.com/KotlinIsland/basedtyping/runs/4741756977?check_suite_focus=true
The text was updated successfully, but these errors were encountered: