Skip to content

Instantly share code, notes, and snippets.

@bschlief
Created June 24, 2014 16:28
Show Gist options
  • Save bschlief/b96c6a2701bfda0323f9 to your computer and use it in GitHub Desktop.
Save bschlief/b96c6a2701bfda0323f9 to your computer and use it in GitHub Desktop.
Wrong number of arguments while making puppet-python: https://github.com/boxen/puppet-python/issues
Already downloaded: /Library/Caches/Homebrew/python-2.7.3-boxen2.tar.bz2
==> Downloading https://gist.github.com/raw/4349132/25662c6b382315b5db67bf949773d76471bbcee7/python-nfs-shutil.diff
==> Patching
patching file Lib/shutil.py
patching file Lib/test/test_shutil.py
patching file Modules/errnomodule.c
==> ./configure --prefix=/opt/boxen/homebrew/Cellar/python/2.7.3-boxen2 --enable-ipv6 --datarootdir=/opt/boxen/homebrew/Cellar/python/2.7.3-boxen2/share --datadir=/opt/boxen/homebrew/Cellar/python/2.7.3-boxen2/share --enable-framework=/opt/boxen/homebrew/Cellar/python/2.7.3-boxen2/Frameworks --without-gcc CFLAGS=-I/opt/boxen/homebrew/include -I/opt/boxen/homebrew/opt/sqlite/include LDFLAGS=-L/opt/boxen/homebrew/lib -L/opt/boxen/homebrew/opt/sqlite/lib MACOSX_DEPLOYMENT_TARGET=10.9
==> make
==> make install PYTHONAPPSDIR=/opt/boxen/homebrew/Cellar/python/2.7.3-boxen2
==> make frameworkinstallextras PYTHONAPPSDIR=/opt/boxen/homebrew/Cellar/python/2.7.3-boxen2/share/python
Error: wrong number of arguments (0 for 3)
Please report this bug:
https://github.com/Homebrew/homebrew/wiki/troubleshooting
/opt/boxen/homebrew/Library/Homebrew/formula.rb:29:in `initialize'
/opt/boxen/homebrew/Library/Taps/boxen/homebrew-brews/python.rb:150:in `new'
/opt/boxen/homebrew/Library/Taps/boxen/homebrew-brews/python.rb:150:in `install'
/opt/boxen/homebrew/Library/Homebrew/build.rb:172:in `block in install'
/opt/boxen/homebrew/Library/Homebrew/formula.rb:259:in `block in brew'
/opt/boxen/homebrew/Library/Homebrew/formula.rb:564:in `block in stage'
/opt/boxen/homebrew/Library/Homebrew/resource.rb:62:in `block in unpack'
/opt/boxen/homebrew/Library/Homebrew/extend/fileutils.rb:21:in `mktemp'
/opt/boxen/homebrew/Library/Homebrew/resource.rb:59:in `unpack'
/opt/boxen/homebrew/Library/Homebrew/resource.rb:52:in `stage'
/opt/boxen/homebrew/Library/Homebrew/formula.rb:562:in `stage'
/opt/boxen/homebrew/Library/Homebrew/formula.rb:254:in `brew'
/opt/boxen/homebrew/Library/Homebrew/build.rb:149:in `install'
/opt/boxen/homebrew/Library/Homebrew/build.rb:44:in `main'
/opt/boxen/homebrew/Library/Homebrew/build.rb:10:in `block in <top (required)>'
Error: /Stage[main]/Python/Package[boxen/brews/python]/ensure: change from absent to 2.7.3-boxen2 failed: Could not update: Execution of 'brew install boxen/brews/python --build-from-source' returned 1: ==> Downloading http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tar.bz2
Already downloaded: /Library/Caches/Homebrew/python-2.7.3-boxen2.tar.bz2
==> Downloading https://gist.github.com/raw/4349132/25662c6b382315b5db67bf949773d76471bbcee7/python-nfs-shutil.diff
==> Patching
patching file Lib/shutil.py
patching file Lib/test/test_shutil.py
patching file Modules/errnomodule.c
==> ./configure --prefix=/opt/boxen/homebrew/Cellar/python/2.7.3-boxen2 --enable-ipv6 --datarootdir=/opt/boxen/homebrew/Cellar/python/2.7.3-boxen2/share --datadir=/opt/boxen/homebrew/Cellar/python/2.7.3-boxen2/share --enable-framework=/opt/boxen/homebrew/Cellar/python/2.7.3-boxen2/Frameworks --without-gcc CFLAGS=-I/opt/boxen/homebrew/include -I/opt/boxen/homebrew/opt/sqlite/include LDFLAGS=-L/opt/boxen/homebrew/lib -L/opt/boxen/homebrew/opt/sqlite/lib MACOSX_DEPLOYMENT_TARGET=10.9
==> make
==> make install PYTHONAPPSDIR=/opt/boxen/homebrew/Cellar/python/2.7.3-boxen2
==> make frameworkinstallextras PYTHONAPPSDIR=/opt/boxen/homebrew/Cellar/python/2.7.3-boxen2/share/python
Error: wrong number of arguments (0 for 3)
Please report this bug:
https://github.com/Homebrew/homebrew/wiki/troubleshooting
/opt/boxen/homebrew/Library/Homebrew/formula.rb:29:in `initialize'
/opt/boxen/homebrew/Library/Taps/boxen/homebrew-brews/python.rb:150:in `new'
/opt/boxen/homebrew/Library/Taps/boxen/homebrew-brews/python.rb:150:in `install'
/opt/boxen/homebrew/Library/Homebrew/build.rb:172:in `block in install'
/opt/boxen/homebrew/Library/Homebrew/formula.rb:259:in `block in brew'
/opt/boxen/homebrew/Library/Homebrew/formula.rb:564:in `block in stage'
/opt/boxen/homebrew/Library/Homebrew/resource.rb:62:in `block in unpack'
/opt/boxen/homebrew/Library/Homebrew/extend/fileutils.rb:21:in `mktemp'
/opt/boxen/homebrew/Library/Homebrew/resource.rb:59:in `unpack'
/opt/boxen/homebrew/Library/Homebrew/resource.rb:52:in `stage'
/opt/boxen/homebrew/Library/Homebrew/formula.rb:562:in `stage'
/opt/boxen/homebrew/Library/Homebrew/formula.rb:254:in `brew'
/opt/boxen/homebrew/Library/Homebrew/build.rb:149:in `install'
/opt/boxen/homebrew/Library/Homebrew/build.rb:44:in `main'
/opt/boxen/homebrew/Library/Homebrew/build.rb:10:in `block in <top (required)>'
@lfyzjck
Copy link

lfyzjck commented Jul 2, 2014

same problem

@pimvanmeurs
Copy link

Here are my proposed changes. Sorry for the issues with formatting, now fixed....

Same issue arises in python3.3.0

It calls .new.brew which calls the formula initialize. Instead replace all the references to external formulas to within the main class and define them as resource "formula"

replace the offending formula.new.brew{.....} line with
resource("formula").stage{ ....}

    class Distribute < Formula
      url 'http://pypi.python.org/packages/source/d/distribute/distribute-0.6.34.tar.gz'
      sha1 'b6f9cfbaf3e63833b71009812a613be13e68f5de'
    end

    class Pip < Formula
      url 'http://pypi.python.org/packages/source/p/pip/pip-1.2.1.tar.gz'
      sha1 '35db84983ef3f66a8a161d320e61d192afc233d9'
    end

    class Python < Formula
      homepage 'http://www.python.org'
      url 'http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tar.bz2'
      sha1 '842c4e2aff3f016feea3c6e992c7fa96e49c9aa0'
      version '2.7.3-boxen2'

to

    class Python < Formula
      homepage 'http://www.python.org'
      url 'http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tar.bz2'
      sha1 '842c4e2aff3f016feea3c6e992c7fa96e49c9aa0'
      version '2.7.3-boxen2'

    resource("Distribute") do
      url 'http://pypi.python.org/packages/source/d/distribute/distribute-0.6.34.tar.gz'
      sha1 'b6f9cfbaf3e63833b71009812a613be13e68f5de'

    Resource("Pip") do
      url 'http://pypi.python.org/packages/source/p/pip/pip-1.2.1.tar.gz'
      sha1 '35db84983ef3f66a8a161d320e61d192afc233d9'
    end

and

    Distribute.new.brew { system "#{bin}/python", *setup_args }
    Pip.new.brew { system "#{bin}/python", *setup_args }

to

    resource("Distribute").stage { system "#{bin}/python", *setup_args }
    resource("Pip"),stage{ system "#{bin}/python", *setup_args }

and it should work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment