Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

stem-1.3.0 added #38911

Closed
wants to merge 1 commit into from
Closed
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
38 changes: 38 additions & 0 deletions Library/Formula/stem.rb
@@ -0,0 +1,38 @@
class Stem < Formula
homepage "https://stem.torproject.org/"
url "https://pypi.python.org/packages/source/s/stem/stem-1.3.0.tar.bz2"
sha256 "770e370156e0e92a9862e4670ee3f4ac385742006e578608528ee16cbab9d416"

depends_on :python if MacOS.version <= :snow_leopard
depends_on :python3 => :optional
option "with-pycrypto", "Build with pycrypto support"

resource "pycrypto" do
url "https://pypi.python.org/packages/source/p/pycrypto/pycrypto-2.6.1.tar.gz"
sha256 "f2ce1e989b272cfcb677616763e0a2e7ec659effa67a88aa92b3a65528f60a3c"
end

def install
if build.with? "pycrypto"
resource("pycrypto").stage do
system "python", *Language::Python.setup_install_args(prefix)
end
end
system "python", *Language::Python.setup_install_args(prefix)
end

test do
Copy link
Member

Choose a reason for hiding this comment

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

Can a test be added to do something more substantial than e.g. --version or --help? See cmake.rb for an example of an application formula with a good test and tinyxml2.rb for an example of a library formula with a good test. Thanks!

# Test stem version.
(testpath/"test.py").write <<-EOS.undent
import stem
import unittest
class TestStem(unittest.TestCase):
def test_stem_version(self):
self.assertEqual(stem.__version__, '1.3.0')

if __name__ == '__main__':
unittest.main()
EOS
system "python", "test.py"
end
end