Adding the code that Nick reviewed to the bug_1612 branch
[tor-bridgedb/rransom.git] / setup.py
blob0ff72c1ad69a3cc7646c4e539c3e90d258c13daa
1 #!/usr/bin/python
2 # BridgeDB by Nick Mathewson.
3 # Copyright (c) 2007-2009, The Tor Project, Inc.
4 # See LICENSE for licensing information
6 import distutils
7 import sys
9 from distutils.core import setup, Command
11 class runTests(Command):
12 # Based on setup.py from mixminion, which is based on setup.py
13 # from Zooko's pyutil package, which is in turn based on
14 # http://mail.python.org/pipermail/distutils-sig/2002-January/002714.html
15 description = "Run unit tests"
16 user_options = []
18 def initialize_options(self):
19 pass
21 def finalize_options(self):
22 build = self.get_finalized_command('build')
23 self.build_purelib = build.build_purelib
24 self.build_platlib = build.build_platlib
26 def run(self):
27 self.run_command('build')
28 old_path = sys.path[:]
29 sys.path[0:0] = [ self.build_purelib, self.build_platlib ]
30 try:
31 testmod = __import__("bridgedb.Tests", globals(), "", [])
32 testmod.Tests.main()
33 finally:
34 sys.path = old_path
36 setup(name='BridgeDB',
37 version='0.1',
38 description='Bridge disbursal tool for use with Tor anonymity network',
39 author='Nick Mathewson',
40 author_email='nickm at torproject dot org',
41 url='https://www.torproject.org',
42 package_dir= {'' : 'lib'},
43 packages=['bridgedb'],
44 py_modules=['TorBridgeDB'],
45 cmdclass={'test' : runTests}