提交 6a7b1a9f 编写于 作者: C Carl Meyer

merge

......@@ -11,3 +11,5 @@ build/*
*.pyc
*.pyo
pip-log.txt
*.~
......@@ -16,6 +16,9 @@ hg tip
* Fixed an issue in the package finder that could result in an
infinite loop while looking for links.
* Fixed issue with ``pip bundle`` and local files (which weren't being
copied into the bundle), from Whit Morriss.
0.6
---
......
......@@ -152,7 +152,7 @@ class InstallCommand(Command):
for filename in options.requirements:
for req in parse_requirements(filename, finder=finder, options=options):
requirement_set.add_requirement(req)
requirement_set.install_files(finder, force_root_egg_info=self.bundle)
requirement_set.install_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
if not options.no_install and not self.bundle:
requirement_set.install(install_options)
installed = ' '.join([req.name for req in
......
......@@ -760,7 +760,7 @@ class RequirementSet(object):
req.uninstall(auto_confirm=auto_confirm)
req.commit_uninstall()
def install_files(self, finder, force_root_egg_info=False):
def install_files(self, finder, force_root_egg_info=False, bundle=False):
unnamed = list(self.unnamed_requirements)
reqs = self.requirements.values()
while reqs or unnamed:
......@@ -806,6 +806,11 @@ class RequirementSet(object):
else:
req_to_install.run_egg_info()
elif install:
##@@ if filesystem packages are not marked
##editable in a req, a non deterministic error
##occurs when the script attempts to unpack the
##build directory
location = req_to_install.build_location(self.build_dir, not self.is_download)
## FIXME: is the existance of the checkout good enough to use it? I don't think so.
unpack = True
......@@ -852,6 +857,9 @@ class RequirementSet(object):
f = open(req_to_install.delete_marker_filename, 'w')
f.write(DELETE_MARKER_MESSAGE)
f.close()
#@@ sketchy way of identifying packages not grabbed from an index
if bundle and req_to_install.url:
self.copy_to_builddir(req_to_install)
if not is_bundle and not self.is_download:
## FIXME: shouldn't be globally added:
finder.add_dependency_links(req_to_install.dependency_links)
......@@ -876,9 +884,19 @@ class RequirementSet(object):
req_to_install.remove_temporary_source()
if install:
self.successfully_downloaded.append(req_to_install)
if bundle and (req_to_install.url and req_to_install.url.startswith('file:///')):
self.copy_to_builddir(req_to_install)
finally:
logger.indent -= 2
def copy_to_builddir(self, req_to_install):
target_dir = req_to_install.editable and self.src_dir or self.build_dir
logger.info("Copying %s to %s" %(req_to_install.name, target_dir))
dest = os.path.join(target_dir, req_to_install.name)
shutil.copytree(req_to_install.source_dir, dest)
shutil.copymode(req_to_install.source_dir, dest)
call_subprocess(["python", "%s/setup.py"%dest, "clean"])
def unpack_url(self, link, location, only_download=False):
if only_download:
location = self.download_dir
......
Metadata-Version: 1.0
Name: FSPkg
Version: 0.1dev
Summary: File system test package
Home-page: http://pip.openplans.org
Author: pip
Author-email: pip@openplans.org
License: UNKNOWN
Description: File system test package
Keywords: pip tests
Platform: UNKNOWN
setup.cfg
setup.py
FSPkg.egg-info/PKG-INFO
FSPkg.egg-info/SOURCES.txt
FSPkg.egg-info/dependency_links.txt
FSPkg.egg-info/entry_points.txt
FSPkg.egg-info/not-zip-safe
FSPkg.egg-info/top_level.txt
fspkg/__init__.py
\ No newline at end of file
# -*- Entry points: -*-
\ No newline at end of file
[egg_info]
tag_build = dev
tag_svn_revision = true
from setuptools import setup, find_packages
import sys, os
version = '0.1'
setup(name='FSPkg',
version=version,
description="File system test package",
long_description="""\
File system test package""",
classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
keywords='pip tests',
author='pip',
author_email='pip@openplans.org',
url='http://pip.openplans.org',
license='',
packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
include_package_data=True,
zip_safe=False,
install_requires=[
# -*- Extra requirements: -*-
],
entry_points="""
# -*- Entry points: -*-
""",
)
Basic setup::
>>> from __main__ import here, reset_env, run_pip, pyversion, lib_py
>>> from __main__ import write_file
>>> from os.path import join
>>> import zipfile
>>> reset_env()
Test making a bundle. We'll grab one package from the filesystem (the
FSPkg dummy package), one from vcs (initools) and one from an index
(pip itself)::
>>> fspkg = 'file://%s/FSPkg' %join(here, 'packages')
>>> dummy = run_pip('install', '-e', fspkg)
>>> pkg_lines = '''-e %s\n''' %fspkg
>>> pkg_lines = pkg_lines + """
... -e svn+http://svn.colorstudy.com/INITools/trunk#egg=initools-dev
... pip"""
>>> write_file('bundle-req.txt', pkg_lines)
>>> result = run_pip('bundle', '-r', 'bundle-req.txt', 'test.pybundle')
>>> bundle = result.files_after.get('test.pybundle', None)
>>> bundle is not None
True
>>> files = zipfile.ZipFile(bundle.full).namelist()
>>> 'src/FSPkg/' in files
True
>>> 'src/initools/' in files
True
>>> 'build/pip/' in files
True
Cleanup::
>>> reset_env()
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册