Skip to content
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

Show dependencies for casks #17940

Merged
merged 3 commits into from
Aug 5, 2024
Merged

Conversation

HaraldNordgren
Copy link
Contributor

@HaraldNordgren HaraldNordgren commented Aug 2, 2024

When running info on a cask show its dependencies.

This mirrors how it already works for formulas.

Fixes #17600.

This comment was marked as resolved.

@request-info request-info bot added the needs response Needs a response from the issue/PR author label Aug 2, 2024
@HaraldNordgren HaraldNordgren force-pushed the cask_deps branch 4 times, most recently from be46dc4 to 1548daa Compare August 3, 2024 12:55
@HaraldNordgren

This comment was marked as resolved.

@HaraldNordgren HaraldNordgren marked this pull request as ready for review August 3, 2024 15:04
@apainintheneck
Copy link
Contributor

This looks really good. I see that for formulae we also include a ✅ or ❌ depending on whether the dependency has already been installed. Do you think it's worth adding something like that for casks too?

==> Dependencies
Required: gettext ✔, pcre2 ✔

As is this PR is already a nice improvement. I just think it would be a nice-to-have thing. Not a blocker though.

@apainintheneck apainintheneck added the cask Homebrew Cask label Aug 3, 2024
Copy link
Member

@carlocab carlocab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your work here!

Some minor, optional, suggestions.

Also agree with the suggestion at #17940 (comment).

Library/Homebrew/cask/info.rb Outdated Show resolved Hide resolved
@HaraldNordgren
Copy link
Contributor Author

HaraldNordgren commented Aug 3, 2024

I agree definitely agree that it would be great to have, but maybe it would be better to do that as a follow-up?

My thinking is like this, it seems the best way to achieve the goal would be to import this function from Library/Homebrew/cmd/info.rb:

      def decorate_dependencies(dependencies)
        deps_status = dependencies.map do |dep|
          if dep.satisfied?([])
            pretty_installed(dep_display_s(dep))
          else
            pretty_uninstalled(dep_display_s(dep))
          end
        end
        deps_status.join(", ")
      end

But I don’t believe that that import is possible without causing a circular import. So that in turn would (probably) require this function to be moved to a shared location, where both places can import it.

Then it grows into much bigger PR. Please correct me if I’m wrong.

@apainintheneck
Copy link
Contributor

Yeah, I think that can be handled as a follow-up.

@carlocab carlocab removed the needs response Needs a response from the issue/PR author label Aug 4, 2024
@carlocab carlocab requested a review from a team August 4, 2024 15:13
@carlocab
Copy link
Member

carlocab commented Aug 4, 2024

Yes, I'm fine with handling this as a follow-up.

Let's wait until the week begins to give other maintainers a chance to review this before we merge it.

Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks @HaraldNordgren! I'm going to create a new tag later today so will hold off merging until after that.

Agreed that e.g. ✅ would be all of: nice to add, worth pulling into a shared location and worth doing in a follow-up PR.

Library/Homebrew/cask/info.rb Outdated Show resolved Hide resolved
@MikeMcQuaid MikeMcQuaid merged commit 87fec6c into Homebrew:master Aug 5, 2024
24 checks passed
@wickles
Copy link
Contributor

wickles commented Aug 7, 2024

Thanks for implementing this. Just want to note some missing features that would be nice to add later:

  • brew deps implementation
  • java dependencies

@HaraldNordgren HaraldNordgren deleted the cask_deps branch August 7, 2024 15:51
@HaraldNordgren
Copy link
Contributor Author

HaraldNordgren commented Aug 7, 2024

@MikeMcQuaid I looked into how to possibly show the installation status for a cask in the same way as it is done for formulas. And the logic around depends_on differs a lot between casks and formulas.

I think I am in over my head here.

@MikeMcQuaid
Copy link
Member

@HaraldNordgren If you can open a draft PR with whatever you've done so far: it'll be easiest to help there when we're talking about code. I believe in you and can help you more ❤️

@HaraldNordgren
Copy link
Contributor Author

Here is a WIP draft for the follow-up: #17982

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cask Homebrew Cask
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show cask dependencies with brew deps and brew info
5 participants