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