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

docutils: revert to restore venv #168183

Merged
merged 1 commit into from
Apr 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
30 changes: 5 additions & 25 deletions Formula/d/docutils.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
class Docutils < Formula
include Language::Python::Virtualenv

desc "Text processing system for reStructuredText"
homepage "https://docutils.sourceforge.io"
url "https://downloads.sourceforge.net/project/docutils/docutils/0.20.1/docutils-0.20.1.tar.gz"
url "https://files.pythonhosted.org/packages/1f/53/a5da4f2c5739cf66290fac1431ee52aff6851c7c8ffd8264f13affd7bcdd/docutils-0.20.1.tar.gz"
sha256 "f08a4e276c3a1583a86dce3e34aba3fe04d02bba2dd51ed16106244e8a923e3b"
license all_of: [:public_domain, "BSD-2-Clause", "GPL-3.0-or-later", "Python-2.0"]
revision 1
Expand All @@ -17,42 +19,20 @@ class Docutils < Formula
sha256 cellar: :any_skip_relocation, x86_64_linux: "480c0b72303e68588d67dd37efc0b55d3971f67561c765f3947d1af96103d790"
end

depends_on "python-setuptools" => :build
depends_on "[email protected]" => [:build, :test]
depends_on "[email protected]" => [:build, :test]

def pythons
deps.map(&:to_formula)
.select { |f| f.name.start_with?("python@") }
.sort_by(&:version)
end
depends_on "[email protected]"

def install
pythons.each do |python|
python_exe = python.opt_libexec/"bin/python"
system python_exe, "-m", "pip", "install", *std_pip_args, "."
end

virtualenv_install_with_resources
bin.glob("*.py") do |f|
bin.install_symlink f => f.basename(".py")
end
end

def caveats
<<~EOS
To run front-end tools, you may need to `brew install #{pythons.last}`
EOS
end

test do
cp prefix/"README.txt", testpath
mkdir_p testpath/"docs"
touch testpath/"docs"/"header0.txt"
system bin/"rst2man.py", testpath/"README.txt"
system bin/"rst2man", testpath/"README.txt"
pythons.each do |python|
python_exe = python.opt_libexec/"bin/python"
system python_exe, "-c", "import docutils"
end
end
end