This change allows the pip module to figure out if something needs to be done during
a dry run using 'pip freeze'. This is implemented for the most basic case: name,
version and state=(present|absent). In other cases it will fall back to the old
behavior.
PyPI moved to a CDN on 2013-05-26, so mirrors are now largely
unnecessary and pip removed the functionality in 1.5. More importantly
(and why I wrote this request): on 2014-02-15 the mirror directory was
taken offline, so mirrors may not work anymore even for pip versions
that support them.
This module supports `virtualenv_site_packages` as an option to control whether or not to include system packages when installing pip packages into a virtual environment.
The default is no, and when you say yes it explicitly it includes a flag to include site packages, otherwise it doesn't provide a flag.
Some versions of virtualenv by default include site packages and other versions by default do not.
This patch just makes both branches explicit, so `virtualenv_site_packages=no` really means no.
Migrated all examples: in DOCUMENTATION=''' string to standalone EXAMPLES=''' string
Added deprecation warning to moduledev.rst and remove deprecated example from it
Fixed up a few typos and uppercased some acronyms.
add consistency to how EXAMPLES are formatted
This code:
```
if name.endswith('.tar.gz') or name.endswith('.tar.bz2') or
name.endswith('.zip'):
is_tar = True
```
was not checking whether name is defined since it is an
optional param.
**Summary**:
There was a bug in the previous commit; pip module would add --use-mirrors options to a source package when state is absent. The bug is resolved in this commit by checking ``not is_package`` in the if branch.
Furthermore, in order to support non-vcs source name like tarballs, we must not add -e option to the arg list. Given this circumstance, this commit have is_tar and is_vcs and the latter is checked to add -e option. Since mirrors do not make sense with vcs or tarball source, this commit will not add --use-mirrors (default to True) as always.
Summary:
Pip module would abort when name is a remote package address because
the module was expecting a version if ``=`` is part of the name value.
Furthermore, the pip module would require either name or requirement to
be a key, although the documentation table said neither was required.
The fact that one of them must be present is not documented in the
documentation leads to confusion. This commit added this fact as part
of description.
In this commit, we resolve the confusion by stating either ``name``
or ``requirement`` is needed. Next, if the user puts remote address
as the value of the ``name`` key, we will not use mirror. Lastly,
if the user uses the remote serivice address as the name of the
package and the user does not supply -e option in extra_vars
(which is the whole point of this commit), we will add -e to
extra_vars so pip command can run with -e option.