Skip to content

Commit

Permalink
Fix up setup.py to be able to work with Python 2.4
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.pyamf.org/branches/test-discovery-780@3396 2dde4cc4-cf3c-0410-b1a3-a9b8ff274da5
  • Loading branch information
njoyce committed Jun 9, 2010
1 parent 6f2ad93 commit f536b66
Showing 1 changed file with 20 additions and 11 deletions.
31 changes: 20 additions & 11 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

from ez_setup import use_setuptools

# 15 seconds is far too long ....
use_setuptools(download_delay=3)

import sys, os.path
Expand All @@ -22,18 +23,8 @@
# since the basedir is set as the first option in sys.path, this works
sys.path.insert(0, base_path)

from pyamf import version

readme = os.path.join(base_path, 'README.txt')

# need to remove all references to imported pyamf modules, as building
# the c extensions change pyamf.util.BufferedByteStream, which blow up
# the tests (at least the first time its built which in case of the
# buildbots is always true)
for k, v in sys.modules.copy().iteritems():
if k and k.startswith('pyamf'):
del sys.modules[k]


class TestCommand(test.test):
"""
Expand Down Expand Up @@ -129,6 +120,24 @@ def get_test_requirements():
return tests_require


def get_version():
mp = sys.meta_path[:]

from pyamf import version

# need to remove all references to imported pyamf modules, as building
# the c extensions change pyamf.util.BufferedByteStream, which blow up
# the tests (at least the first time its built which in case of the
# buildbots is always true)
for k, v in sys.modules.copy().iteritems():
if k and k.startswith('pyamf'):
del sys.modules[k]

sys.meta_path = mp

return version


keyw = """\
amf amf0 amf3 flex flash remoting rpc http flashplayer air bytearray
objectproxy arraycollection recordset actionscript decoder encoder
Expand All @@ -141,7 +150,7 @@ def get_test_requirements():


setup(name = "PyAMF",
version = str(version),
version = str(get_version()),
description = "AMF support for Python",
long_description = open(readme, 'rt').read(),
url = "http://pyamf.org",
Expand Down

0 comments on commit f536b66

Please sign in to comment.