-
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
Git Dependencies do not respect lock file #2325
Comments
I have done more digging and made a PR, but I have run into one problem poetry/tests/puzzle/test_solver.py Lines 1276 to 1309 in 288d997
I disagree with this unit test and the expectations it sets which has led me to file this bug but now looks like it is an intentional feature. The solver solves the problem based on the constraints it is given, but it seems like in this situation it is making assumptions about how constraints should be treated and ignored. On an install, I would expect that the constraints of a lock file are respected no matter the condition and on an update a new set of constraints are generated and evaluated on the course of action that should be taken. The installation process already has the update capability which generates a new lock file, putting in the new revision to lock the git repo to. But then the solver ignores that and just always updates. This seems like a bad situation and not respecting the |
We as well were just affected by this bug, when a breaking change happened in one of our git dependency repositories, which broke our trunk and CI didn't catch it. |
+1 on this. Although it may be a corner case, I have a scenario where I need poetry to install the latest and greatest from a git master on every You can argue that "you should not do this" and so on, but it serves a real world scenario. I can agree that this behavior should perhaps not be the default though. So whatever happens, at least give the option to be able to fetch the latest and greatest and not remove this current functionality. |
i agree with @fredrikaverpil , as i have a scenario currently needs this behavior.
upon i believe that this will cover all needed behaviors with the most simplistic and intuitive syntax. |
Has any progress been made on this yet? I have an issue where I'm trying to do like hagaika mentioned with: private-repo = {git = "path/to/my.git", branch="specific-branch"} I'm hoping to get it to install the latest version of that branch, but it doesn't detect it. Has this been resolved? If not, is there a temporary work around? |
Is this an issue anymore? I tried to reproduce the bug using poetry @wakemaster39 could you please confirm that the bug is still relevant in |
@mprudek this issue is 100% still a problem in the 1.1.x branch. My changes got merged into master (1.2.x) and never got the back port. |
@wakemaster39 I can confirm that I made a mistake during reproducing of the bug. I basically swapped words During the first reproducing, my
And with this settings, But I overlooked that your
so I changed my
... and then I updated & pushed the dependency repo, Thanks for patience 🙂 . I had the feeling that these observations could help also others. |
just incase anyone else also run into this. Another side effect going on here without my changes merged in, doing a This one burns me alot as I forget that this occurs on anywhere I didn't apply my patch |
@wakemaster39 Which PR is it please? I would like to know what exactly is the syntax of the github dependency in |
Oh i didn't realize I failed to link it back here: #3867 |
Its not an issue with the pyproject, no syntax will make this work. Its an issue with the resolver and detection of it being a git package. The resolver needs the patch or it will just treat it like a local package and it will never function right. |
Ok, thanks. So it is related to the git installation vs. directotry installation issue. The other issue about not respecting the resolved commit hash in |
#3875 should actually resolve the gitlock. That came out of my original concern. But again, stuck in 1.2.x branch only so still an issue in 1.1.x |
Fixed at #3875, this can be closed |
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. |
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, RedHat 7.6, Fedora 31
Poetry version: 1.0.5
Issue
I have created two test projects so I could verify this, simple contain no code just a git repo where one of them lives. The expectation I had, is what when I do a
poetry install
for the first time on mytest2
repo that is shown above, a poetry lock file would be generated which contains the revision that the git should be locked against. This currently happensI then go and push a change to
test-abc
and runpoetry install
again in test 2. My expectation here is that nothing changes and life is good. This is where I believe to be a Critical bug occurs:The contents of the poetry.lock file remain unchanged, but I now have an updated dependency.
Now rev locking to that specific revision works, it is just the default does not respect the poetry.lock file defeating the purpose of the lock file here in my opinion.
There are a couple other issues I found on here which reference resolving tags and branches to specific hashes in the lock file, so it seems like the intent here is for git to install the specific hash and not latest by default.
The text was updated successfully, but these errors were encountered: