Force an update when changing a dependency to point to a local directory#1240
Force an update when changing a dependency to point to a local directory#1240pdavies wants to merge 1 commit intopython-poetry:masterfrom
Conversation
jacebrowning
left a comment
There was a problem hiding this comment.
Thanks! I've definitely run into this problem.
| operations.append(Update(pkg, package)) | ||
| elif ( | ||
| package.source_type == "directory" | ||
| and pkg.source_type != "directory" |
There was a problem hiding this comment.
I wonder if we can generalize this for any type of change in the dependency source type (file -> directory or directory -> git for instance)
There was a problem hiding this comment.
That seems like it ought to be the right answer, but it looks as though the detection of source type for installed packages is not currently reliable:
- so far as I can see, it is only ever set to "git" (or nothing at all)
- and actually, even packages that are installed as "directory" are reported as "git", if it happens that the code is in a git repository (which is fairly likely to be the case).
- I suppose by the time you get to doing
pip freeze, the two cases are indistinguishable
- I suppose by the time you get to doing
Presumably in an ideal world the source_type of installed packages would be made reliable - but it's not clear to me how to achieve that.
sdispater
left a comment
There was a problem hiding this comment.
Could you add a test covering this issue?
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
|
@pdavies Are you still working on this? If not, I can try to work on a fix for this bug. |
|
Whoops, I haven't been on GItHub in ages. Happy to see that this has been fixed independently! |
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This fixes the following bug:
poetry update- but nothing happens. It insists that the dependency is already installed, and we continue to use the installed copy insite-packages. Worse,poetry shownow believes that you are using the local directory, even though you're not (aspip showconfirms).