Repository navigation
internal library dosen't get version from git repo #5617
Copy link
Copy link
Open
Labels
area/solverRelated to the dependency resolverRelated to the dependency resolverkind/bugSomething isn't working as expectedSomething isn't working as expectedstatus/triageThis issue needs to be triagedThis issue needs to be triaged
Description
-
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 (
-vvvoption). -
OS version and name: MacOS 11.1 (20C69)
-
Poetry version:
1.1.13(tried also on1.2.0b1) -
- Link of a Gist with the contents of your pyproject.toml file: in the issues
Issue
I have a repo A that is using 2 other repos B and C
C is also using B
A's pyproject.toml
B = {git = "<B's github repo>", branch = "my-branch"}
C = {version="^0.5.8"}
B's pyproject.toml (in my-branch branch)
[tool.poetry]
name = "B"
version = "0.31.0"
C's pyproject.toml
B = {version=">=0.30"}
The current versions of B in my PyPI server are (0.30.0 || 0.30.1 || 0.30.2 || 0.30.3 || 0.30.4)
It seems that when locking C inside A, C's not aware B's version is acceptable
Because no versions of B match >0.30,<0.30.1 || >0.30.1,<0.30.2 || >0.30.2,<0.30.3 || >0.30.3,<0.30.4 || >0.30.4
and B (0.30.0) depends on B (0.30.0), B (>=0.30,<0.30.1 || >0.30.1,<0.30.2 || >0.30.2,<0.30.3 || >0.30.3,<0.30.4 || >0.30.4) requires B (0.30.0).
And because B (0.30.1) depends on B (0.30.1)
and B (0.30.2) depends on B (0.30.2), B (>=0.30,<0.30.3 || >0.30.3,<0.30.4 || >0.30.4) requires B (0.30.0 || 0.30.1 || 0.30.2).
And because B (0.30.3) depends on B (0.30.3)
and B (0.30.4) depends on B (0.30.4), B (>=0.30) requires B (0.30.0 || 0.30.1 || 0.30.2 || 0.30.3 || 0.30.4).
Because no versions of C match >0.5.8
and C (0.5.8) depends on B (>=0.30), C (>=0.5.8) requires B (>=0.30).
Thus, C (>=0.5.8) requires B (0.30.0 || 0.30.1 || 0.30.2 || 0.30.3 || 0.30.4).
And because B (rev my-branch) depends on B (rev my-branch), C (>=0.5.8) is incompatible with B (rev my-branch).
So, because A depends on both B (branch my-branch) and C (>=0.5.8), version solving failed.
I tried to publish my-branch as a beta branch, changed A's to use this version, and still had the same issue
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area/solverRelated to the dependency resolverRelated to the dependency resolverkind/bugSomething isn't working as expectedSomething isn't working as expectedstatus/triageThis issue needs to be triagedThis issue needs to be triaged
Activity
[-]internal library dosen't get github version[/-][+]internal library dosen't get version from git repo[/+]radoering commentedon May 18, 2022
May be related to python-poetry/poetry-core#325 and an incorrect call of
is_same_package_as()in a place where only the names of the packages should be compared.abn commentedon May 18, 2022
@ericman93 Can you please try the version on master?
Using pipx
pipx install --suffix=@git --force 'poetry @ git+https://github.com/python-poetry/poetry.git' poetry@git lock poetry@git installUsing a container (podman | docker)
ericman93 commentedon May 20, 2022
I got this error
By the way, before having the final error I had got
Dis my lib that exists in another poetry sourceThe source of
Dwasn't mentioned inpyproject.tomlAfter adding
sourcekey it worked (but failed on the above)It used to work before without adding the source, is that a new feature? to look only in the specified source?
abn commentedon May 26, 2022
@ericman93 I think that is #5682
ericman93 commentedon May 27, 2022
#5782 relates to the 404 (not an issue, just asked if this is a new feature) or to the AssertionError?
abn commentedon May 27, 2022
Ah I misunderstood your comment.
The assertion error looks like it's the solver, that scenario should work but will have to look more closely. Do you have the
-vvvlogs with the latest master?ericman93 commentedon May 27, 2022
abn commentedon May 27, 2022
Maybe also the bits above the stack trace as well.
ericman93 commentedon May 27, 2022
ronlut commentedon May 29, 2022
@abn Happens for me without any internal library
dimbleby commentedon May 29, 2022
@ronlut if you have a repro that does not require private libraries and repositories please share your
pyproject.tomlandpoetry.lockso that maintainers have a shot at debugging.ronlut commentedon May 29, 2022
@dimbleby Thanks for the comment, actually now I tried pinning down the problem and it stops working as soon as I even add a private registry (source), without any library from the private registry.
What interesting though, is if I remove the
secondary=trueline, delete the poetry.lock and rerun poetry update everything works.So I think the problem is a declaration of a private registry with
secondary=true.EDIT: actually, I think it is even not consistent. I ran poetry update 3 times with private source and
secondary=true(without any libraries) and it failed 2 times out of 3.With
secondary=false, sometimes it works sometimes it doesn't.dimbleby commentedon Jun 7, 2022
absent a way of reproducing this, we can guess that it's the same as #5791 (which did give a repro)
ericman93 commentedon Jun 8, 2022
tried with
mainversionchanged
albusto GitHub version that its version is0.37.1after deleting
poetry.lockand runningpoetry updateagain it finished in 55 seconds but nothing changedI deleted the lock again, and ran
poetry update -vvv, and I got the same issue as beforefull poetry lock logs are attached
poetry.log
dimbleby commentedon Jun 8, 2022
You still have not provided a way to reproduce this.
I see that your log has reached scikit-learn 0.22.2.post1 when it falls over, the post-release here is consistent with this being the same thing as #5791
NB the fix was in poetry-core, not poetry, so if you are trying to test the fix it is poetry-core that you will need to update
ericman93 commentedon Jun 13, 2022
it finally ran until
Writing lock filepart, but it crashedand after running it again it failed for different reason
I'm trying to reproduce it with open repo but with no luck
I have multiple internal repos that are using more internal repos from my gemfury
ericman93 commentedon Jun 23, 2022
I removed the problematic sckitlearn package and now the solving is finishes successfully 100% of the time
the issue now is that it can't get a valid version of
uvicorn(albus is from my private repo)but reading the
-vvvlogs I do see that it found a valid versionright after locking the file, I see those logs (and those are the only libs with extras)
Albus's pyproject
pyproject of the repo I'm trying to update
full logs are attached
poetry.log
@dimbleby still no repo but a major update