homebrew-core icon indicating copy to clipboard operation
homebrew-core copied to clipboard

mkdocs-material 9.5.41 (new formula)

Open clintonsteiner opened this issue 1 year ago • 5 comments

  • [ x ] Have you followed the guidelines for contributing?
  • [ x ] Have you ensured that your commits follow the commit style guide?
  • [ x ] Have you checked that there aren't other open pull requests for the same formula update/change?
  • [ x ] Have you built your formula locally with HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>, where <formula> is the name of the formula you're submitting?
  • [ x ] Is your test running fine brew test <formula>, where <formula> is the name of the formula you're submitting?
  • [ x ] Does your build pass brew audit --strict <formula> (after doing HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>)? If this is a new formula, does it pass brew audit --new <formula>?

clintonsteiner avatar Oct 18 '24 05:10 clintonsteiner

Thanks for contributing to Homebrew! :tada: It looks like you're having trouble with a CI failure. See our contribution guide for help. You may be most interested in the section on dealing with CI failures. You can find the CI logs in the Checks tab of your pull request.

github-actions[bot] avatar Oct 18 '24 05:10 github-actions[bot]

Is this a Material Design library for mkdocs? If so, this should probably depends_on "mkdocs", and have a test similar to the one in mkdocs.

If it's a drop-in replacement for mkdocs (as the docs seem to suggest), then again, a similar test to mkdocs seems warranted, and a conflicts_with clause should probably be added.

gromgit avatar Oct 18 '24 12:10 gromgit

This is a design library for mkdocs @gromgit

clintonsteiner avatar Oct 18 '24 14:10 clintonsteiner

Changed to take pr comments, thanks @gromgit

clintonsteiner avatar Oct 18 '24 14:10 clintonsteiner

Is there a reason this formula doesn't use a similar test to the mkdocs formula, given that it's a library for the latter rather than just a general-purpose Python library?

gromgit avatar Oct 21 '24 01:10 gromgit

I don't want to create a test as intense as creating a site with the theme and instead would prefer to use a test that makes sure its available

clintonsteiner avatar Oct 21 '24 14:10 clintonsteiner

@chenrui333 let me know how I can fix this up enough to be committed

clintonsteiner avatar Oct 22 '24 00:10 clintonsteiner

Looks like my earlier comment is pertinent, in that mkdocs-material seems to want to be a standalone mkdocs.

This change builds and tests successfully on my local system:

diff --git a/Formula/m/mkdocs-material.rb b/Formula/m/mkdocs-material.rb
index 2af492f2dee..45306341eae 100644
--- a/Formula/m/mkdocs-material.rb
+++ b/Formula/m/mkdocs-material.rb
@@ -7,9 +7,10 @@ class MkdocsMaterial < Formula
   license "MIT"
 
   depends_on "libyaml"
-  depends_on "mkdocs"
   depends_on "[email protected]"
 
+  conflicts_with "mkdocs", because: "both install `mkdocs` binaries"
+
   resource "babel" do
     url "https://files.pythonhosted.org/packages/2a/74/f1bc80f23eeba13393b7222b11d95ca3af2c1e28edca18af487137eefed9/babel-2.16.0.tar.gz"
     sha256 "d1f3554ca26605fe173f3de0c65f750f5a42f924499bf134de6423582298e316"
@@ -65,6 +66,11 @@ class MkdocsMaterial < Formula
     sha256 "0096d52e9dad9939c3d975a774666af186eda617e6ca84df4c94dec30004f2a8"
   end
 
+  resource "mkdocs" do
+    url "https://files.pythonhosted.org/packages/bc/c6/bbd4f061bd16b378247f12953ffcb04786a618ce5e904b8c5a01a0309061/mkdocs-1.6.1.tar.gz"
+    sha256 "7b432f01d928c084353ab39c57282f29f92136665bdd6abf7c1ec8d822ef86f2"
+  end
+
   resource "mkdocs-get-deps" do
     url "https://files.pythonhosted.org/packages/98/f5/ed29cd50067784976f25ed0ed6fcd3c2ce9eb90650aa3b2796ddf7b6870b/mkdocs_get_deps-0.2.0.tar.gz"
     sha256 "162b3d129c7fad9b19abfdcb9c1458a651628e4b1dea628ac68790fb3061c60c"
@@ -148,6 +154,7 @@ class MkdocsMaterial < Formula
   def install
     ENV["PIP_USE_PEP517"] = "1"
     virtualenv_install_with_resources
+    bin.install_symlink libexec/"bin/mkdocs"
   end
 
   test do
@@ -164,6 +171,6 @@ class MkdocsMaterial < Formula
 
       And some deeply meaningful prose.
     EOS
-    system "mkdocs", "build", "--clean"
+    system bin/"mkdocs", "build", "--clean"
   end
 end
diff --git a/Formula/m/mkdocs.rb b/Formula/m/mkdocs.rb
index 534532b4789..00409ab9cfd 100644
--- a/Formula/m/mkdocs.rb
+++ b/Formula/m/mkdocs.rb
@@ -20,6 +20,8 @@ class Mkdocs < Formula
   depends_on "libyaml"
   depends_on "[email protected]"
 
+  conflicts_with "mkdocs-material", because: "both install `mkdocs` binaries"
+
   resource "click" do
     url "https://files.pythonhosted.org/packages/96/d3/f04c7bfcf5c1862a2a5b845c6b2b360488cf47af55dfa79c98f6a6bf98b5/click-8.1.7.tar.gz"
     sha256 "ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de"

gromgit avatar Oct 23 '24 12:10 gromgit

@gromgit Thank you for the help

clintonsteiner avatar Oct 28 '24 20:10 clintonsteiner

@chenrui333 bump to close this issue

clintonsteiner avatar Nov 04 '24 20:11 clintonsteiner

mkdocs add conflict warning for mkdocs-material should done as followup

chenrui333 avatar Nov 06 '24 15:11 chenrui333

Wouldn't that result in a broken state temporarily if these commits aren't merged in the same pr?

clintonsteiner avatar Nov 06 '24 15:11 clintonsteiner

Wouldn't that result in a broken state temporarily if these commits aren't merged in the same pr?

The window for breakage is small, and since this is the new formula, it's highly unlikely to be installed before installing the unmodified mkdocs formula. Even then, you'd get a link error when installing mkdocs; the conflicts_with clause just stops the conflicting install before actually doing anything.

gromgit avatar Nov 07 '24 02:11 gromgit

Fixed and put seperate pr here https://github.com/Homebrew/homebrew-core/pull/196959

clintonsteiner avatar Nov 07 '24 09:11 clintonsteiner

I think the fix should be here as a commit to pass CI correctly.

daeho-ro avatar Nov 07 '24 14:11 daeho-ro

I think the fix should be here as a commit to pass CI correctly.

Corrected

clintonsteiner avatar Nov 07 '24 19:11 clintonsteiner

It seems that you pushed new cask to the releated PR, so I will take care about new one and close this.

  • https://github.com/Homebrew/homebrew-core/pull/196959

daeho-ro avatar Nov 08 '24 00:11 daeho-ro