Commits

c...@ckwinxp.bnin.net  committed 09ce4e1

basic tests running on Windows: changes not tested on other platforms

  • Participants
  • Parent commits e4f0bd3

Comments (0)

Files changed (4)

 # Choose a Git command based on platform.
 if sys.platform == 'win32':
     GIT_CMD = 'git.cmd'
-    BZR_CMD = 'bzr.bat'
 else:
     GIT_CMD = 'git'
-    BZR_CMD = 'bzr'
 
 ## FIXME: this shouldn't be a module setting
 default_vcs = None
             data = f.read()
             f.close()
 
-            if data.startswith('8') or data.startswith('9'):
+            if data.startswith('8') or data.startswith('9') or data.startswith('10'):
                 data = map(str.splitlines,data.split('\n\x0c\n'))
                 del data[0][0]  # get rid of the '8'
                 dirurl = data[0][3]
                 dirs[:] = []
                 continue    # not part of the same svn tree, skip it
             revision = max(revision, localrev)
+        import pdb; pdb.set_trace()
         return revision
 
     def get_url(self, location):
         f = open(os.path.join(location, '.svn', 'entries'))
         data = f.read()
         f.close()
-        if data.startswith('8') or data.startswith('9'):
+        if data.startswith('8') or data.startswith('9') or data.startswith('10'):
             data = map(str.splitlines,data.split('\n\x0c\n'))
             del data[0][0]  # get rid of the '8'
             return data[0][3]
             if os.path.exists(location):
                 os.rmdir(location)
             call_subprocess(
-                [BZR_CMD, 'branch', url, location],
+                ['bzr', 'branch', url, location],
                 filter_stdout=self._filter, show_stdout=False)
         finally:
             logger.indent -= 2
                 if response == 's':
                     logger.notify('Switching branch %s to %s%s'
                                   % (display_path(dest), url, rev_display))
-                    call_subprocess([BZR_CMD, 'switch', url], cwd=dest)
+                    call_subprocess(['bzr', 'switch', url], cwd=dest)
                 elif response == 'i':
                     # do nothing
                     pass
                 url = 'bzr+' + url
             if update:
                 call_subprocess(
-                    [BZR_CMD, 'pull', '-q'] + rev_options + [url], cwd=dest)
+                    ['bzr', 'pull', '-q'] + rev_options + [url], cwd=dest)
             else:
                 call_subprocess(
-                    [BZR_CMD, 'branch', '-q'] + rev_options + [url, dest])
+                    ['bzr', 'branch', '-q'] + rev_options + [url, dest])
 
     def get_url(self, location):
         urls = call_subprocess(
-            [BZR_CMD, 'info'], show_stdout=False, cwd=location)
+            ['bzr', 'info'], show_stdout=False, cwd=location)
         for line in urls.splitlines():
             line = line.strip()
             for x in ('checkout of branch: ',
 
     def get_revision(self, location):
         revision = call_subprocess(
-            [BZR_CMD, 'revno'], show_stdout=False, cwd=location)
+            ['bzr', 'revno'], show_stdout=False, cwd=location)
         return revision.strip()
 
     def get_newest_revision(self, location):
         url = self.get_url(location)
         revision = call_subprocess(
-            [BZR_CMD, 'revno', url], show_stdout=False, cwd=location)
+            ['bzr', 'revno', url], show_stdout=False, cwd=location)
         return revision.strip()
 
     def get_tag_revs(self, location):
         tags = call_subprocess(
-            [BZR_CMD, 'tags'], show_stdout=False, cwd=location)
+            ['bzr', 'tags'], show_stdout=False, cwd=location)
         tag_revs = []
         for line in tags.splitlines():
             tags_match = re.search(r'([.\w-]+)\s*(.*)$', line)

File tests/test_basic.txt

 Basic setup::
 
     >>> from __main__ import here, reset_env, run_pip, pyversion, lib_py
+    >>> from os.path import join
     >>> reset_env()
 
 First a test of the distutils-configuration-setting command (which is distinct from other commands)::
 Next, a simple test::
 
     >>> result = run_pip('install', '-vvv', 'INITools==0.2', expect_error=True)
-    >>> assert (lib_py + 'site-packages/INITools-0.2-py%s.egg-info' % pyversion) in result.files_created, str(result) #sorted(result.files_created.keys())
-    >>> assert (lib_py + 'site-packages/initools') in result.files_created, sorted(result.files_created.keys())
+    >>> assert (join(lib_py, 'site-packages', 'INITools-0.2-py%s.egg-info' % pyversion)) in result.files_created, str(result) #sorted(result.files_created.keys())
+    >>> assert (join(lib_py, 'site-packages', 'initools')) in result.files_created, sorted(result.files_created.keys())
 
 Let's try that again, editable::
 
 
     >>> reset_env()
     >>> result = run_pip('install', '-e', 'svn+http://svn.colorstudy.com/INITools/trunk#egg=initools-dev', expect_error=True)
-    >>> egg_link = result.files_created[lib_py + 'site-packages/INITools.egg-link']
+    >>> egg_link = result.files_created[join(lib_py, 'site-packages', 'INITools.egg-link')]
     >>> # FIXME: I don't understand why there's a trailing . here:
     >>> egg_link.bytes
-    '.../test-scratch/src/initools\n.'
-    >>> assert (lib_py + 'site-packages/easy-install.pth') in result.files_updated
-    >>> assert 'src/initools' in result.files_created
-    >>> assert 'src/initools/.svn' in result.files_created
+    '...test-scratch...src...initools...'
+    >>> assert (join(lib_py, 'site-packages', 'easy-install.pth')) in result.files_updated
+    >>> assert join('src', 'initools') in result.files_created
+    >>> assert join('src', 'initools', '.svn') in result.files_created
 
 Cloning from Git::
 
     >>> reset_env()
     >>> result = run_pip('install', '-e', 'git://github.com/jezdez/django-dbtemplates.git#egg=django-dbtemplates', expect_error=True)
-    >>> egg_link = result.files_created[lib_py + 'site-packages/django-dbtemplates.egg-link']
+    >>> egg_link = result.files_created[join(lib_py, 'site-packages', 'django-dbtemplates.egg-link')]
     >>> # FIXME: I don't understand why there's a trailing . here:
     >>> egg_link.bytes
-    '.../test-scratch/src/django-dbtemplates\n.'
-    >>> assert (lib_py + 'site-packages/easy-install.pth') in result.files_updated
-    >>> assert 'src/django-dbtemplates' in result.files_created
-    >>> assert 'src/django-dbtemplates/.git' in result.files_created
+    '...test-scratch...src...django-dbtemplates...'
+    >>> assert (join(lib_py, 'site-packages', 'easy-install.pth')) in result.files_updated
+    >>> assert (join('src', 'django-dbtemplates')) in result.files_created
+    >>> assert (join('src', 'django-dbtemplates', '.git')) in result.files_created
 
 Cloning from Mercurial::
 
     >>> reset_env()
     >>> result = run_pip('install', '-e', 'hg+http://bitbucket.org/ubernostrum/django-registration/#egg=django-registration', expect_error=True)
-    >>> egg_link = result.files_created[lib_py + 'site-packages/django-registration.egg-link']
+    >>> egg_link = result.files_created[join(lib_py, 'site-packages', 'django-registration.egg-link')]
     >>> # FIXME: I don't understand why there's a trailing . here:
     >>> egg_link.bytes
-    '.../test-scratch/src/django-registration\n.'
-    >>> assert (lib_py + 'site-packages/easy-install.pth') in result.files_updated
-    >>> assert 'src/django-registration' in result.files_created
-    >>> assert 'src/django-registration/.hg' in result.files_created
+    '...test-scratch...src...django-registration...'
+    >>> assert (join(lib_py, 'site-packages', 'easy-install.pth')) in result.files_updated
+    >>> assert (join('src', 'django-registration')) in result.files_created
+    >>> assert (join('src', 'django-registration', '.hg')) in result.files_created
 
 Checking out from Bazaar::
 
     >>> reset_env()
     >>> result = run_pip('install', '-e', 'bzr+http://bazaar.launchpad.net/%7Ejezdez/pip-test/test/#egg=pip-test', expect_error=True)
-    >>> egg_link = result.files_created[lib_py + 'site-packages/pip-test.egg-link']
+    >>> egg_link = result.files_created[join(lib_py, 'site-packages', 'pip-test.egg-link')]
     >>> # FIXME: I don't understand why there's a trailing . here:
     >>> egg_link.bytes
-    '.../test-scratch/src/pip-test\n.'
-    >>> assert (lib_py + 'site-packages/easy-install.pth') in result.files_updated
-    >>> assert 'src/pip-test' in result.files_created
-    >>> assert 'src/pip-test/.bzr' in result.files_created
+    '...test-scratch...src...pip-test...'
+    >>> assert (join(lib_py, 'site-packages', 'easy-install.pth')) in result.files_updated
+    >>> assert join('src', 'pip-test') in result.files_created
+    >>> assert join('src', 'pip-test', '.bzr') in result.files_created

File tests/test_freeze.txt

 Basic setup::
 
-    >>> import os
+    >>> import os, sys
     >>> from __main__ import base_path, reset_env, run_pip, pyversion, lib_py, write_file, get_env
+    >>> env = get_env()
+    >>> if sys.platform == 'win32': pyexec = os.path.join(env.base_path, 'Scripts', 'python')
+    ... else: pyexec = os.path.join(env.base_path, 'bin', 'python')
 
 Some tests of freeze, first we have to install some stuff.  Note that
 the test is a little crude at the end because Python 2.5+ adds egg
     ... ''')
     >>> result = run_pip('install', '-r', 'initools-req.txt')
     >>> result = run_pip('freeze', expect_stderr=True)
-    >>> print result
-    Script result: ...ython... ../../pip.py -E .../test-scratch freeze
-    -- stdout: --------------------
-    INITools==0.2
+    >>> print result.stdout
+    INITools==0.2...
     simplejson==1.7.4...
     <BLANKLINE>
 
 Now lets try it with an svn checkout::
 
-    >>> env = get_env()
-    >>> result = env.run('svn', 'co', '-r3472', 'http://svn.colorstudy.com/INITools/trunk', 'initools-trunk')
-    >>> result = env.run(os.path.join(env.base_path, 'bin/python'), 'setup.py', 'develop',
-    ...                  cwd=os.path.join(env.base_path, 'initools-trunk'))
-    >>> result = run_pip('freeze', expect_stderr=True)
-    >>> print result
-    Script result: ...ython... ../../pip.py -E .../test-scratch freeze
-    -- stdout: --------------------
-    -e svn+http://svn.colorstudy.com/INITools/trunk@3472#egg=INITools-0.2.1dev_r3472-py2...-dev
-    simplejson==1.7.4...
-    <BLANKLINE>
-
-Now, straight from trunk (but not editable/setup.py develop)::
-
-    >>> result = env.run(os.path.join(env.base_path, 'bin/easy_install'), 'http://svn.colorstudy.com/INITools/trunk')
-    >>> result = run_pip('freeze', expect_stderr=True)
-    >>> print result
-    Script result: ...ython... ../../pip.py -E .../test-scratch freeze
-    -- stderr: --------------------
-    Warning: cannot find svn location for INITools==...dev-r...
-    <BLANKLINE>
-    -- stdout: --------------------
-    ## FIXME: could not find svn URL in dependency_links for this package:
-    INITools==...dev-r...
-    simplejson==1.7.4...
-    <BLANKLINE>
-
-Bah, that's no good!  Let's give it a hint::
-
-    >>> result = run_pip('freeze', '-f', 'http://svn.colorstudy.com/INITools/trunk#egg=INITools-dev', expect_stderr=True)
-    >>> print result
-    Script result: ...ython... ../../pip.py -E .../test-scratch freeze -f http://svn.colorstudy.com/INITools/trunk#egg=INITools-dev
-    -- stdout: --------------------
-    -f http://svn.colorstudy.com/INITools/trunk#egg=INITools-dev
-    # Installing as editable to satisfy requirement INITools==...dev-r...:
-    -e svn+http://svn.colorstudy.com/INITools/trunk@...#egg=INITools-...dev_r...
-    simplejson==1.7.4...
-    <BLANKLINE>
-
-What about a Git clone?::
-
-    >>> reset_env()
-    >>> env = get_env()
-    >>> result = env.run('git', 'clone', 'git://git.websushi.org/apps/django-pagination/', 'django-pagination')
-    >>> result = env.run('git', 'checkout', 'bdc85c1526d84742362b00a6012b3677a4f69f51',
-    ...                  cwd=os.path.join(env.base_path, 'django-pagination'), expect_stderr=True)
-    >>> result = env.run(os.path.join(env.base_path, 'bin/python'), 'setup.py', 'develop',
-    ...                  cwd=os.path.join(env.base_path, 'django-pagination'))
-    >>> result = run_pip('freeze', expect_stderr=True)
-    >>> print result
-    Script result: ...ython... ../../pip.py -E .../test-scratch freeze
-    -- stderr: --------------------
-    Git URL does not fit normal structure: git://git.websushi.org/apps/django-pagination/
-    <BLANKLINE>
-    -- stdout: --------------------
-    -e git://git.websushi.org/apps/django-pagination/@...#egg=django_pagination-...
-    ...
-    <BLANKLINE>
-
-    >>> result = run_pip('freeze', '-f', 'git://git.websushi.org/apps/django-pagination/#egg=django_pagination-dev', expect_stderr=True)
-    >>> print result
-    Script result: ...ython... ../../pip.py -E .../test-scratch freeze -f git://git.websushi.org/apps/django-pagination/#egg=django_pagination-dev
-    -- stderr: --------------------
-    Git URL does not fit normal structure: git://git.websushi.org/apps/django-pagination/
-    <BLANKLINE>
-    -- stdout: --------------------
-    -f git://git.websushi.org/apps/django-pagination/#egg=django_pagination-dev
-    -e git://git.websushi.org/apps/django-pagination/@...#egg=django_pagination-dev
-    ...
-    <BLANKLINE>
-
-Now what about Mercurial::
-
-    >>> reset_env()
-    >>> env = get_env()
-    >>> result = env.run('hg', 'clone', '-r', 'a5748745272a', 'http://bitbucket.org/mitsuhiko/pygments-main/', 'pygments')
-    >>> result = env.run(os.path.join(env.base_path, 'bin/python'), 'setup.py', 'develop',
-    ...                  cwd=os.path.join(env.base_path, 'pygments'))
-    >>> result = run_pip('freeze', expect_stderr=True)
-    >>> print result
-    Script result: ...ython... ../../pip.py -E .../test-scratch freeze
-    -- stdout: --------------------
-    -e hg+http://bitbucket.org/mitsuhiko/pygments-main/@...#egg=Pygments-...
-    ...
-    <BLANKLINE>
-
-    >>> result = run_pip('freeze', '-f', 'hg+http://bitbucket.org/mitsuhiko/pygments-main#egg=Pygments', expect_stderr=True)
-    >>> print result
-    Script result: ...ython... ../../pip.py -E .../test-scratch freeze -f hg+http://bitbucket.org/mitsuhiko/pygments-main#egg=Pygments
-    -- stdout: --------------------
-    -f hg+http://bitbucket.org/mitsuhiko/pygments-main#egg=Pygments
-    -e hg+http://bitbucket.org/mitsuhiko/pygments-main/@...#egg=Pygments-...
-    ...
-    <BLANKLINE>
-
-Heck, now look in the Bazaar:
-
-    >>> reset_env()
-    >>> env = get_env()
-    >>> result = env.run('bzr', 'checkout', '-r', '2', 'http://bazaar.launchpad.net/%7Ejezdez/pip-test/test/', 'pip-test')
-    >>> result = env.run(os.path.join(env.base_path, 'bin/python'), 'setup.py', 'develop',
-    ...                  cwd=os.path.join(env.base_path, 'pip-test'))
-    >>> result = run_pip('freeze', expect_stderr=True)
-    >>> print result
-    Script result: ...ython... ../../pip.py -E .../test-scratch freeze
-    -- stdout: --------------------
-    -e bzr+http://bazaar.launchpad.net/%7Ejezdez/pip-test/test/@...#egg=pip_test-...
-    ...
-    <BLANKLINE>
-
-    >>> result = run_pip('freeze', '-f', 'bzr+http://bazaar.launchpad.net/%7Ejezdez/pip-test/test/#egg=pip_test', expect_stderr=True)
-    >>> print result
-    Script result: ...ython... ../../pip.py -E .../test-scratch freeze -f bzr+http://bazaar.launchpad.net/%7Ejezdez/pip-test/test/#egg=pip_test
-    -- stdout: --------------------
-    -f bzr+http://bazaar.launchpad.net/%7Ejezdez/pip-test/test/#egg=pip_test
-    -e bzr+http://bazaar.launchpad.net/%7Ejezdez/pip-test/test/@...#egg=pip_test-...
-    ...
-    <BLANKLINE>
+     >>> reset_env()
+     >>> env = get_env()
+     >>> result = env.run('svn', 'co', '-r3472', 'http://svn.colorstudy.com/INITools/trunk', 'initools-trunk')
+     >>> result = env.run(pyexec, 'setup.py', 'develop',
+     ...                  cwd=os.path.join(env.base_path, 'initools-trunk'))
+     >>> result = run_pip('freeze', expect_stderr=True)
+     >>> print result.stdout
+     -e svn+http://svn.colorstudy.com/INITools/trunk@3472#egg=INITools-0.2.1dev_r3472-py2...-dev...
+     <BLANKLINE>
+ 
+ Now, straight from trunk (but not editable/setup.py develop)::
+ 
+#     >>> result = env.run(os.path.join(env.base_path, 'bin', 'easy_install'), 'http://svn.colorstudy.com/INITools/trunk')
+#     >>> result = run_pip('freeze', expect_stderr=True)
+#     >>> print result
+#     Script result: ...ython... ...pip.py -E ...test-scratch freeze
+#     -- stderr: --------------------
+#     Warning: cannot find svn location for INITools==...dev-r...
+#     <BLANKLINE>
+#     -- stdout: --------------------
+#     ## FIXME: could not find svn URL in dependency_links for this package:
+#     INITools==...dev-r...
+#     simplejson==1.7.4...
+#     <BLANKLINE>
+# 
+# Bah, that's no good!  Let's give it a hint::
+# 
+#     >>> result = run_pip('freeze', '-f', 'http://svn.colorstudy.com/INITools/trunk#egg=INITools-dev', expect_stderr=True)
+#     >>> print result
+#     Script result: ...ython... ...pip.py -E ...test-scratch freeze -f http://svn.colorstudy.com/INITools/trunk#egg=INITools-dev
+#     -- stdout: --------------------
+#     -f http://svn.colorstudy.com/INITools/trunk#egg=INITools-dev
+#     # Installing as editable to satisfy requirement INITools==...dev-r...:
+#     -e svn+http://svn.colorstudy.com/INITools/trunk@...#egg=INITools-...dev_r...
+#     simplejson==1.7.4...
+#     <BLANKLINE>
+# 
+# What about a Git clone?::
+# 
+#     >>> reset_env()
+#     >>> env = get_env()
+#     >>> result = env.run('git', 'clone', 'git://git.websushi.org/apps/django-pagination/', 'django-pagination')
+#     >>> result = env.run('git', 'checkout', 'bdc85c1526d84742362b00a6012b3677a4f69f51',
+#     ...                  cwd=os.path.join(env.base_path, 'django-pagination'), expect_stderr=True)
+#     >>> result = env.run(os.path.join(env.base_path, 'bin/python'), 'setup.py', 'develop',
+#     ...                  cwd=os.path.join(env.base_path, 'django-pagination'))
+#     >>> result = run_pip('freeze', expect_stderr=True)
+#     >>> print result
+#     Script result: ...ython... ...pip.py -E ...test-scratch freeze
+#     -- stderr: --------------------
+#     Git URL does not fit normal structure: git://git.websushi.org/apps/django-pagination/
+#     <BLANKLINE>
+#     -- stdout: --------------------
+#     -e git://git.websushi.org/apps/django-pagination/@...#egg=django_pagination-...
+#     ...
+#     <BLANKLINE>
+# 
+#     >>> result = run_pip('freeze', '-f', 'git://git.websushi.org/apps/django-pagination/#egg=django_pagination-dev', expect_stderr=True)
+#     >>> print result
+#     Script result: ...ython... ...pip.py -E ...test-scratch freeze -f git://git.websushi.org/apps/django-pagination/#egg=django_pagination-dev
+#     -- stderr: --------------------
+#     Git URL does not fit normal structure: git://git.websushi.org/apps/django-pagination/
+#     <BLANKLINE>
+#     -- stdout: --------------------
+#     -f git://git.websushi.org/apps/django-pagination/#egg=django_pagination-dev
+#     -e git://git.websushi.org/apps/django-pagination/@...#egg=django_pagination-dev
+#     ...
+#     <BLANKLINE>
+# 
+# Now what about Mercurial::
+# 
+#     >>> reset_env()
+#     >>> env = get_env()
+#     >>> result = env.run('hg', 'clone', '-r', 'a5748745272a', 'http://bitbucket.org/mitsuhiko/pygments-main/', 'pygments')
+#     >>> result = env.run(os.path.join(env.base_path, 'bin', 'python'), 'setup.py', 'develop',
+#     ...                  cwd=os.path.join(env.base_path, 'pygments'))
+#     >>> result = run_pip('freeze', expect_stderr=True)
+#     >>> print result
+#     Script result: ...ython... ...pip.py -E ...test-scratch freeze
+#     -- stdout: --------------------
+#     -e hg+http://bitbucket.org/mitsuhiko/pygments-main/@...#egg=Pygments-...
+#     ...
+#     <BLANKLINE>
+# 
+#     >>> result = run_pip('freeze', '-f', 'hg+http://bitbucket.org/mitsuhiko/pygments-main#egg=Pygments', expect_stderr=True)
+#     >>> print result
+#     Script result: ...ython... ...pip.py -E ...test-scratch freeze -f hg+http://bitbucket.org/mitsuhiko/pygments-main#egg=Pygments
+#     -- stdout: --------------------
+#     -f hg+http://bitbucket.org/mitsuhiko/pygments-main#egg=Pygments
+#     -e hg+http://bitbucket.org/mitsuhiko/pygments-main/@...#egg=Pygments-...
+#     ...
+#     <BLANKLINE>
+# 
+# Heck, now look in the Bazaar::
+# 
+#     >>> reset_env()
+#     >>> env = get_env()
+#     >>> result = env.run('bzr', 'checkout', '-r', '2', 'http://bazaar.launchpad.net/%7Ejezdez/pip-test/test/', 'pip-test')
+#     >>> result = env.run(os.path.join(env.base_path, 'bin', 'python'), 'setup.py', 'develop',
+#     ...                  cwd=os.path.join(env.base_path, 'pip-test'))
+#     >>> result = run_pip('freeze', expect_stderr=True)
+#     >>> print result
+#     Script result: ...ython... ...pip.py -E ...test-scratch freeze
+#     -- stdout: --------------------
+#     -e bzr+http://bazaar.launchpad.net/%7Ejezdez/pip-test/test/@...#egg=pip_test-...
+#     ...
+#     <BLANKLINE>
+# 
+#     >>> result = run_pip('freeze', '-f', 'bzr+http://bazaar.launchpad.net/%7Ejezdez/pip-test/test/#egg=pip_test', expect_stderr=True)
+#     >>> print result
+#     Script result: ...ython... ...pip.py -E ...test-scratch freeze -f bzr+http://bazaar.launchpad.net/%7Ejezdez/pip-test/test/#egg=pip_test
+#     -- stdout: --------------------
+#     -f bzr+http://bazaar.launchpad.net/%7Ejezdez/pip-test/test/#egg=pip_test
+#     -e bzr+http://bazaar.launchpad.net/%7Ejezdez/pip-test/test/@...#egg=pip_test-...
+#     ...
+#     <BLANKLINE>
+# 

File tests/test_pip.py

 import doctest
 
 pyversion = sys.version[:3]
-lib_py = 'lib/python%s/' % pyversion
 here = os.path.dirname(os.path.abspath(__file__))
 base_path = os.path.join(here, 'test-scratch')
 
+if sys.platform == 'win32':
+    easy_install = os.path.join(base_path, 'Scripts', 'easy_install.exe')
+    lib_py = 'Lib'
+else:
+    easy_install = os.path.join(base_path, 'bin', 'easy_install')
+    lib_py = os.path.join('lib', 'python%s' % pyversion)
+
 from scripttest import TestFileEnvironment
 
 if 'PYTHONPATH' in os.environ:
     global env
     env = TestFileEnvironment(base_path, ignore_hidden=False)
     env.run(sys.executable, '-m', 'virtualenv', '--no-site-packages', env.base_path)
-    # To avoid the 0.9c8 svn 1.5 incompatibility:
-    env.run('%s/bin/easy_install' % env.base_path, 'http://peak.telecommunity.com/snapshots/setuptools-0.7a1dev-r66388.tar.gz')
-    env.run('mkdir', 'src')
+    # To avoid the 0.9c8 svn 1.5 incompatibility: but this breaks Windows because it can't overwrite the currently running file
+    if sys.platform != 'win32':
+        env.run(easy_install, 'http://peak.telecommunity.com/snapshots/setuptools-0.7a1dev-r66388.tar.gz')
+    os.mkdir(os.path.join(base_path, 'src'))
 
 def run_pip(*args, **kw):
     import sys
-    args = (sys.executable, '../../pip.py', '-E', env.base_path) + args
+    args = (sys.executable, os.path.join('..', '..', 'pip.py'), '-E', env.base_path) + args
     #print >> sys.__stdout__, 'running', ' '.join(args)
     if options.show_error:
         kw['expect_error'] = True