-
-
Notifications
You must be signed in to change notification settings - Fork 10.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
update-python-resources: skip dependencies of excluded packages #12427
Conversation
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.
Nice work! Some style thoughts.
Library/Homebrew/utils/pypi.rb
Outdated
@@ -281,4 +286,17 @@ def update_python_resources!(formula, version: nil, package_name: nil, extra_pac | |||
|
|||
true | |||
end | |||
|
|||
def json_to_packages(json_tree, main_package, exclude_packages) | |||
return [] if json_tree.nil? |
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.
return [] if json_tree.nil? | |
return [] if json_tree.blank? |
return [] if json_tree.nil? | ||
|
||
json_tree.flat_map do |package_json| | ||
package = Package.new("#{package_json["name"]}==#{package_json["version"]}") |
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.
package = Package.new("#{package_json["name"]}==#{package_json["version"]}") | |
package = [Package.new("#{package_json["name"]}==#{package_json["version"]}")] |
Library/Homebrew/utils/pypi.rb
Outdated
|
||
json_tree.flat_map do |package_json| | ||
package = Package.new("#{package_json["name"]}==#{package_json["version"]}") | ||
[package] + if package == main_package || exclude_packages.exclude?(package) |
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.
[package] + if package == main_package || exclude_packages.exclude?(package) | |
package += if package == main_package || exclude_packages.exclude?(package) |
Thanks again @FnControlOption! |
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?For example, this makes excluding
ipython
fromjupyterlab
also exclude unused dependencies, not justipython
.pipgrip --tree jupyterlab