Permalink
Browse files

merge with develop

  • Loading branch information...
2 parents 7c8470a + ee44e13 commit d0c3138fbfa16a79f457d89b3e3556d68e49384d @qwcode qwcode committed Feb 16, 2013
Showing with 59 additions and 23 deletions.
  1. +2 −0 .travis.yml
  2. +2 −0 AUTHORS.txt
  3. +2 −0 docs/configuration.txt
  4. +2 −2 docs/cookbook.txt
  5. +1 −1 docs/development.txt
  6. +1 −1 docs/logic.txt
  7. +1 −1 docs/make.bat
  8. +1 −1 docs/usage.txt
  9. +1 −1 pip/baseparser.py
  10. +34 −7 pip/commands/__init__.py
  11. +1 −1 pip/commands/list.py
  12. +2 −2 pip/req.py
  13. +9 −6 tests/test_basic.py
View
@@ -9,6 +9,8 @@ python:
before_install:
- sudo apt-get install subversion bzr mercurial
- echo -e "[web]\ncacerts = /etc/ssl/certs/ca-certificates.crt" >> ~/.hgrc
+ - git config --global user.email "python-virtualenv@googlegroups.com"
+ - git config --global user.name "Pip"
install: pip install nose virtualenv scripttest mock
script: nosetests
notifications:
View
@@ -18,6 +18,7 @@ David (d1b)
Dmitry Gladkov
Donald Stufft
Francesco
+Geoffrey Lehée
Georgi Valkov
Hugo Lopes Tavares
Ian Bicking
@@ -29,6 +30,7 @@ Jannis Leidel
Jay Graves
John-Scott Atlakson
Jon Parise
+Jonas Nockert
Josh Bronson
Kamal Bin Mustafa
Kelsey Hightower
View
@@ -15,6 +15,8 @@ platforms.
* On Unix and Mac OS X the configuration file is: :file:`$HOME/.pip/pip.conf`
* On Windows, the configuration file is: :file:`%HOME%\\pip\\pip.ini`
+You can set a custom path location for the config file using the environment variable ``PIP_CONFIG_FILE``.
+
The names of the settings are derived from the long command line option, e.g.
if you want to use a different package index (``--index-url``) and set the
HTTP timeout (``--default-timeout``) to 60 seconds your config file would
View
@@ -125,7 +125,7 @@ Ensuring Repeatability
Three things are required to fully guarantee a repeatable installation using requirements files.
-1. The requirements file was generated by ``pip freeze`` or you're sure it only contains requirements that specifiy a specific version.
+1. The requirements file was generated by ``pip freeze`` or you're sure it only contains requirements that specify a specific version.
2. The installation is performed using :ref:`--no-deps <install_--no-deps>`. This guarantees that only what is explicitly listed in the requirements file is installed.
-3. The installation is performed against a index or find-links location that is guaranteed to *not* allow achives to be changed and updated without a version increase.
+3. The installation is performed against an index or find-links location that is guaranteed to *not* allow archives to be changed and updated without a version increase.
View
@@ -7,7 +7,7 @@ Pull Requests
Submit Pull Requests against the `develop` branch.
-Provide a good description of what your doing and why.
+Provide a good description of what you're doing and why.
Provide tests that cover your changes and try to run the tests locally first.
View
@@ -68,7 +68,7 @@ pip requires a working VCS command on your path: git, hg, svn, or bzr.
VCS projects can be installed in :ref:`editable mode <editable-installs>` (using the :ref:`--editable <install_--editable>` option) or not.
-* For editable installs, the clone location by default is "<venv path>/src/SomeProject" in virtual environments, and "<cwd>/src/SomeProject" for global intalls.
+* For editable installs, the clone location by default is "<venv path>/src/SomeProject" in virtual environments, and "<cwd>/src/SomeProject" for global installs.
The :ref:`--src <install_--src>` option can be used to modify this location.
* For non-editable installs, the project is built locally in a temp dir and then installed normally.
View
@@ -21,7 +21,7 @@ if "%1" == "help" (
echo. singlehtml to make a single large HTML file
echo. pickle to make pickle files
echo. json to make JSON files
- echo. htmlhelp to make HTML files and a HTML help project
+ echo. htmlhelp to make HTML files and an HTML help project
echo. qthelp to make HTML files and a qthelp project
echo. devhelp to make HTML files and a Devhelp project
echo. epub to make an epub
View
@@ -72,7 +72,7 @@ Examples
$ pip install --upgrade SomePackage
-4) Install a local project in in "editable" mode. See the section on :ref:`Editable Installs <editable-installs>`.
+4) Install a local project in "editable" mode. See the section on :ref:`Editable Installs <editable-installs>`.
::
View
@@ -162,7 +162,7 @@ def update_defaults(self, defaults):
val = option.convert_value(key, val)
except optparse.OptionValueError:
e = sys.exc_info()[1]
- print("An error occured during configuration: %s" % e)
+ print("An error occurred during configuration: %s" % e)
sys.exit(3)
defaults[option.dest] = val
return defaults
View
@@ -31,17 +31,33 @@
}
-def get_summaries(ignore_hidden=True):
- """Return a sorted list of (command name, command summary)."""
- items = []
+commands_order = [
+ InstallCommand,
+ UninstallCommand,
+ FreezeCommand,
+ ListCommand,
+ ShowCommand,
+ SearchCommand,
+ ZipCommand,
+ UnzipCommand,
+ BundleCommand,
+ HelpCommand,
+]
- for name, command_class in commands.items():
+
+def get_summaries(ignore_hidden=True, ordered=True):
+ """Yields sorted (command name, command summary) tuples."""
+
+ if ordered:
+ cmditems = _sort_commands(commands, commands_order)
+ else:
+ cmditems = commands.items()
+
+ for name, command_class in cmditems:
if ignore_hidden and command_class.hidden:
continue
- items.append((name, command_class.summary))
-
- return sorted(items)
+ yield (name, command_class.summary)
def get_similar_commands(name):
@@ -56,3 +72,14 @@ def get_similar_commands(name):
guess = False
return guess
+
+
+def _sort_commands(cmddict, order):
+ def keyfn(key):
+ try:
+ return order.index(key[1])
+ except ValueError:
+ # unordered items should come last
+ return 0xff
+
+ return sorted(cmddict.items(), key=keyfn)
View
@@ -43,7 +43,6 @@ def __init__(self, *args, **kw):
default=False,
help='If in a virtualenv that has global access, do not list globally-installed packages.')
-
index_opts = make_option_group(index_group, self.parser)
self.parser.insert_option_group(0, index_opts)
@@ -121,6 +120,7 @@ def run_editables(self, options):
self.output_package_listing(installed_packages)
def output_package_listing(self, installed_packages):
+ installed_packages = sorted(installed_packages, key=lambda dist: dist.project_name.lower())
for dist in installed_packages:
if dist_is_editable(dist):
line = '%s (%s, %s)' % (dist.project_name, dist.version, dist.location)
View
@@ -305,7 +305,7 @@ def egg_info_path(self, filename):
filenames = [f for f in filenames if f.endswith('.egg-info')]
if not filenames:
- raise InstallationError('No files/directores in %s (from %s)' % (base, filename))
+ raise InstallationError('No files/directories in %s (from %s)' % (base, filename))
assert filenames, "No files/directories in %s (from %s)" % (base, filename)
# if we have more than one match, we pick the toplevel one. This can
@@ -849,7 +849,7 @@ def add_requirement(self, install_req):
else:
if self.has_requirement(name):
raise InstallationError(
- 'Double requirement given: %s (aready in %s, name=%r)'
+ 'Double requirement given: %s (already in %s, name=%r)'
% (install_req, self.get_requirement(name), name))
self.requirements[name] = install_req
## FIXME: what about other normalizations? E.g., _ vs. -?
View
@@ -13,7 +13,7 @@
from pip.backwardcompat import ssl
from tests.test_pip import (here, reset_env, run_pip, pyversion, mkdir,
- src_folder, write_file)
+ src_folder, write_file, path_to_url)
from tests.local_repos import local_checkout
from tests.path import Path
@@ -105,7 +105,7 @@ def test_install_from_mirrors_with_specific_mirrors():
Test installing a package from a specific PyPI mirror.
"""
e = reset_env()
- result = run_pip('install', '-vvv', '--use-mirrors', '--mirrors', "http://d.pypi.python.org/", '--no-index', 'INITools==0.2')
+ result = run_pip('install', '-vvv', '--use-mirrors', '--mirrors', "http://a.pypi.python.org/", '--no-index', 'INITools==0.2')
egg_info_folder = e.site_packages / 'INITools-0.2-py%s.egg-info' % pyversion
initools_folder = e.site_packages / 'initools'
assert egg_info_folder in result.files_created, str(result)
@@ -503,10 +503,13 @@ def test_install_package_with_root():
"""
env = reset_env()
root_dir = env.scratch_path/'root'
- result = run_pip('install', '--root', root_dir, "--install-option=--home=''",
- '--install-option=--install-lib=lib/python', "initools==0.1")
-
- assert Path('scratch')/'root'/'lib'/'python'/'initools' in result.files_created, str(result)
+ find_links = path_to_url(os.path.join(here, 'packages'))
+ result = run_pip('install', '--root', root_dir, '-f', find_links, '--no-index', 'simple==1.0')
+ normal_install_path = env.root_path / env.site_packages / 'simple-1.0-py%s.egg-info' % pyversion
+ #use distutils to change the root exactly how the --root option does it
+ from distutils.util import change_root
+ root_path = change_root(os.path.join(env.scratch, 'root'), normal_install_path)
+ assert root_path in result.files_created, str(result)
def test_find_command_folder_in_path():

0 comments on commit d0c3138

Please sign in to comment.