-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Do not freeze file-based Poetry dependency version #4334
Do not freeze file-based Poetry dependency version #4334
Conversation
@@ -54,7 +54,7 @@ def freeze_top_level_dependencies_except(dependencies) | |||
|
|||
next unless (locked_version = locked_details&.fetch("version")) | |||
|
|||
next if locked_details&.dig("source", "type") == "directory" | |||
next if locked_details&.dig("source", "type") == "directory" || locked_details&.dig("source", "type") == "file" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really write Ruby but maybe this is better written as:
next if ["directory", "file"].include? locked_details&.dig("source", "type")
Also, looking at the schema we might need to also special-case URL dependencies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I slightly prefer it, but I don't feel strongly about it
@@ -151,5 +151,20 @@ | |||
) | |||
end | |||
end | |||
|
|||
context "with file dependencies" do | |||
let(:dependencies) { [] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rubocop will complain that this is indented 4 spaces instead of 2
I noticed a couple of files names were changed but their references in the tests weren't, those tests will likely fail because of that I think? Overall I think this looks good, but it's been a while since I looked at this code so might need to dig into it a bit more. |
@jurre thanks for the feedback, changes applied! I'm still not 100% sure if we need to special-case dependabot-core/python/spec/dependabot/python/file_parser/poetry_files_parser_spec.rb Lines 174 to 181 in 35032ea
|
python/lib/dependabot/python/file_updater/pyproject_preparer.rb
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
had a typo when ya'll dropped the quotes
python/lib/dependabot/python/file_updater/pyproject_preparer.rb
Outdated
Show resolved
Hide resolved
@jurre sorry for so much back and forth, TBH I'm writing this a little blind. I'll actually set up a dev environment for this if it fails after the next run. 2 follow-up questions:
Thanks for your help! |
Tbh, I am not sure! Maybe we can add a test for it?
Once it's merged I can cut a release fairly quickly and can roll it out usually the same or next day. |
There's a couple of failing python tests on CI @phillipuniverse, would you mind taking a look at those? |
@jurre yup, sorry for letting this languish I'll get this sorted out today. |
1465a94
to
f7392f3
Compare
…e and directory dependencies
ok! @jurre I feel pretty good about this now, sorry again for how long this whole thing has taken. New updates:
Thanks for your help getting this over the line! We should probably squash merge this when it's all done. |
@jurre last thing here - I have 1 failing test locally and I'm not sure why: But even with my change in |
I am currently working on upgrading pipenv so I think I can tackle that failure, it doesn't seem related to these changes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Fixes #4333. This was modeled after #2361 with the same type of tests.
I also renamed the test files to differentiate between directory-based and file-based dependencies, both of which can be specified by a path.