New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix up the bundle support #1116

Merged
merged 1 commit into from Aug 7, 2013
Jump to file or symbol
Failed to load files and symbols.
+25 −9
Diff settings

Always

Just for now

Copy path View file
@@ -37,7 +37,8 @@
class InstallRequirement(object):
def __init__(self, req, comes_from, source_dir=None, editable=False,
url=None, as_egg=False, update=True, prereleases=None):
url=None, as_egg=False, update=True, prereleases=None,
from_bundle=False):
self.extras = ()
if isinstance(req, string_types):
req = pkg_resources.Requirement.parse(req)
@@ -65,6 +66,7 @@ def __init__(self, req, comes_from, source_dir=None, editable=False,
self.uninstalled = None
self.use_user_site = False
self.target_dir = None
self.from_bundle = from_bundle
# True if pre-releases are acceptable
if prereleases:
@@ -776,12 +778,10 @@ def bundle_requirements(self):
url = None
yield InstallRequirement(
package, self, editable=True, url=url,
update=False, source_dir=dest_dir)
update=False, source_dir=dest_dir, from_bundle=True)
for dest_dir in self._bundle_build_dirs:
package = os.path.basename(dest_dir)
yield InstallRequirement(
package, self,
source_dir=dest_dir)
yield InstallRequirement(package, self,source_dir=dest_dir, from_bundle=True)
def move_bundle_files(self, dest_build_dir, dest_src_dir):
base = self._temp_build_dir
@@ -1059,9 +1059,14 @@ def prepare_files(self, finder, force_root_egg_info=False, bundle=False):
unpack = True
url = None
# If a checkout exists, it's unwise to keep going.
# Version inconsistencies are logged later, but do not fail the installation.
if os.path.exists(os.path.join(location, 'setup.py')):
# In the case where the req comes from a bundle, we should
# assume a build dir exists and move on
if req_to_install.from_bundle:
pass
# If a checkout exists, it's unwise to keep going. version
# inconsistencies are logged later, but do not fail the
# installation.
elif os.path.exists(os.path.join(location, 'setup.py')):
msg = textwrap.dedent("""
pip can't proceed with requirement '%s' due to a pre-existing build directory.
location: %s
Copy path View file
Binary file not shown.
@@ -0,0 +1,11 @@
import os
from tests.lib import reset_env, pip_install_local, packages
def test_install_pybundle():
"""
Test intalling a *.pybundle file
"""
env = reset_env()
result = pip_install_local(os.path.join(packages, 'simplebundle.pybundle'), expect_temp=True)
result.assert_installed('simple', editable=False)
result.assert_installed('simple2', editable=False)
Copy path View file
@@ -451,7 +451,7 @@ def run_pip(*args, **kw):
def pip_install_local(*args, **kw):
"""Run 'pip install' using --find-links against our local test packages"""
run_pip('install', '--no-index', '--find-links=%s' % find_links, *args, **kw)
return run_pip('install', '--no-index', '--find-links=%s' % find_links, *args, **kw)
def write_file(filename, text, dest=None):
"""Write a file in the dest (default=env.scratch_path)
ProTip! Use n and p to navigate between commits in a pull request.