| 1 |
#!/usr/bin/env python |
|---|
| 2 |
|
|---|
| 3 |
import re, sys |
|---|
| 4 |
from distutils.core import setup |
|---|
| 5 |
|
|---|
| 6 |
VERSIONFILE = "foolscap/_version.py" |
|---|
| 7 |
verstr = "unknown" |
|---|
| 8 |
try: |
|---|
| 9 |
verstrline = open(VERSIONFILE, "rt").read() |
|---|
| 10 |
except EnvironmentError: |
|---|
| 11 |
pass # Okay, there is no version file. |
|---|
| 12 |
else: |
|---|
| 13 |
VSRE = r"^verstr = ['\"]([^'\"]*)['\"]" |
|---|
| 14 |
mo = re.search(VSRE, verstrline, re.M) |
|---|
| 15 |
if mo: |
|---|
| 16 |
verstr = mo.group(1) |
|---|
| 17 |
else: |
|---|
| 18 |
print "unable to find version in %s" % (VERSIONFILE,) |
|---|
| 19 |
raise RuntimeError("if %s.py exists, it is required to be well-formed" |
|---|
| 20 |
% (VERSIONFILE,)) |
|---|
| 21 |
|
|---|
| 22 |
setup_args = { |
|---|
| 23 |
'name': "foolscap", |
|---|
| 24 |
'version': verstr, |
|---|
| 25 |
'description': "Foolscap contains an RPC protocol for Twisted.", |
|---|
| 26 |
'author': "Brian Warner", |
|---|
| 27 |
'author_email': "warner-foolscap@lothar.com", |
|---|
| 28 |
'url': "http://foolscap.lothar.com/trac", |
|---|
| 29 |
'license': "MIT", |
|---|
| 30 |
'long_description': """\ |
|---|
| 31 |
Foolscap (aka newpb) is a new version of Twisted's native RPC protocol, known |
|---|
| 32 |
as 'Perspective Broker'. This allows an object in one process to be used by |
|---|
| 33 |
code in a distant process. This module provides data marshaling, a remote |
|---|
| 34 |
object reference system, and a capability-based security model. |
|---|
| 35 |
""", |
|---|
| 36 |
'classifiers': [ |
|---|
| 37 |
"Development Status :: 3 - Alpha", |
|---|
| 38 |
"Operating System :: OS Independent", |
|---|
| 39 |
"License :: OSI Approved :: MIT License", |
|---|
| 40 |
"Programming Language :: Python", |
|---|
| 41 |
"Topic :: Internet", |
|---|
| 42 |
"Topic :: Software Development :: Libraries :: Python Modules", |
|---|
| 43 |
"Topic :: System :: Distributed Computing", |
|---|
| 44 |
"Topic :: System :: Networking", |
|---|
| 45 |
"Topic :: Software Development :: Object Brokering", |
|---|
| 46 |
], |
|---|
| 47 |
'platforms': ["any"], |
|---|
| 48 |
|
|---|
| 49 |
'packages': ["foolscap", "foolscap/slicers", "foolscap/logging", |
|---|
| 50 |
"foolscap/test"], |
|---|
| 51 |
'scripts': ["bin/flogtool"], |
|---|
| 52 |
} |
|---|
| 53 |
|
|---|
| 54 |
try: |
|---|
| 55 |
# If setuptools is installed, then we'll add setuptools-specific |
|---|
| 56 |
# arguments to the setup args. |
|---|
| 57 |
import setuptools |
|---|
| 58 |
except ImportError: |
|---|
| 59 |
pass |
|---|
| 60 |
else: |
|---|
| 61 |
setup_args['install_requires'] = ['twisted >= 2.4.0'] |
|---|
| 62 |
setup_args['extras_require'] = { 'secure_connections' : ["pyOpenSSL"] } |
|---|
| 63 |
# note that pyOpenSSL-0.7 and recent Twisted causes unit test failures, |
|---|
| 64 |
# see bug #62 |
|---|
| 65 |
|
|---|
| 66 |
if __name__ == '__main__': |
|---|
| 67 |
setup(**setup_args) |
|---|