bb947a4ead
Closes #24923. Signed-off-by: FX Coudert <fxcoudert@gmail.com>
23 lines
818 B
Ruby
23 lines
818 B
Ruby
class Autopep8 < Formula
|
|
include Language::Python::Virtualenv
|
|
|
|
desc "Automatically formats Python code to conform to the PEP 8 style guide"
|
|
homepage "https://github.com/hhatto/autopep8"
|
|
url "https://github.com/hhatto/autopep8/archive/v1.3.4.tar.gz"
|
|
sha256 "4d6c88bae7f008c70201d0178ed40c3bca9a63a4ad8ecceb69bf8b952dc86a1d"
|
|
|
|
depends_on "python@2" if MacOS.version <= :snow_leopard
|
|
|
|
def install
|
|
venv = virtualenv_create(libexec)
|
|
system libexec/"bin/pip", "install", "-v", "--no-binary", ":all:",
|
|
"--ignore-installed", buildpath
|
|
system libexec/"bin/pip", "uninstall", "-y", name
|
|
venv.pip_install_and_link buildpath
|
|
end
|
|
|
|
test do
|
|
output = shell_output("echo \"x='homebrew'\" | #{bin}/autopep8 -")
|
|
assert_equal "x = 'homebrew'", output.strip
|
|
end
|
|
end
|