-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Add better heuristic for build detection #2773
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
Conversation
efiop
left a comment
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 for the PR @n3hrox ! π Please see some comments up above.
dvc/updater.py
Outdated
| "formula": "Run {yellow}brew{reset} upgrade dvc", | ||
| "apt": ( | ||
| "rpm": "Run {yellow}yum{reset} update dvc", | ||
| "osxpkg": "Run {yellow}brew{reset} upgrade dvc", |
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.
osxpkg is not the same as brew formula. We need to add build.py with PKG = 'formula' or PKG = "brew"(this one is even better π ) to our homebrew formula https://github.com/iterative/homebrew-dvc/blob/master/Formula/dvc.rb (after that we'll submit the same changes to homebrew-core).
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 think we could also echo somewhere there, need to take a closer look.
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'll include that into our and homebrew-core formulas after this PR is merged.
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.
For the record: Added iterative/homebrew-dvc@68d0f02 . Will play around with it and then release a new version and submit it to homebrew-core.
dvc/utils/pkg.py
Outdated
|
|
||
|
|
||
| def is_conda(): | ||
| def get_package_manager(): |
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.
Btw, no good reason to make this dynamic, let's just:
try:
from .build import PKG # file created during dvc build
except ImportError:
PKG = None
and then just import PKG where needed, instead of get_package_manager
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.
DeepSource shows that as anti-pattern, do you still want to keep without function wrap?
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.
@n3hrox DS is saying that PKG is unused, which is on purpose here, so we are fine π
efiop
left a comment
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.
Looks great! π Just a few minor comments left.
efiop
left a comment
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.
Outstanding job! π₯ Thank you so much @n3hrox ! π
β Have you followed the guidelines in the Contributing to DVC list?
π Check this box if this PR does not require documentation updates, or if it does and you have created a separate PR in dvc.org with such updates (or at least opened an issue about it in that repo). Please link below to your PR (or issue) in the dvc.org repo.
β Have you checked DeepSource, CodeClimate, and other sanity checks below? We consider their findings recommendatory and don't expect everything to be addresses. Please review them carefully and fix those that actually improve code or fix bugs.
Thank you for the contribution - we'll try to review it as soon as possible. π