Skip to content

Commit 87dd157

Browse files
committed
Removed broken and no-longer-useful -E and PIP_RESPECT_VIRTUALENV options.
1 parent 73c0433 commit 87dd157

File tree

5 files changed

+10
-123
lines changed

5 files changed

+10
-123
lines changed

docs/index.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -254,11 +254,6 @@ and to bail if not, use::
254254

255255
export PIP_REQUIRE_VIRTUALENV=true
256256

257-
To tell pip to automatically use the currently active virtualenv::
258-
259-
export PIP_RESPECT_VIRTUALENV=true
260-
261-
Providing an environment with ``-E`` will be ignored.
262257

263258
Using pip with virtualenvwrapper
264259
---------------------------------

docs/news.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ Next release (1.1) schedule
66

77
Beta release mid-July 2011, final release early August.
88

9+
develop (unreleased)
10+
--------------------
11+
12+
* Removed ``-E`` option and ``PIP_RESPECT_VIRTUALENV``; both use a
13+
restart-in-venv mechanism that's broken, and neither one is useful since
14+
every virtualenv now has pip inside it.
15+
916
1.0.1 (2011-04-30)
1017
------------------
1118

pip/basecommand.py

Lines changed: 3 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
from pip.baseparser import parser, ConfigOptionParser, UpdatingDefaultsHelpFormatter
1212
from pip.download import urlopen
1313
from pip.exceptions import BadCommand, InstallationError, UninstallationError
14-
from pip.venv import restart_in_venv
1514
from pip.backwardcompat import StringIO, urllib, urllib2, walk_packages
1615

1716
__all__ = ['command_dict', 'Command', 'load_all_commands',
@@ -45,8 +44,8 @@ def __init__(self):
4544

4645
def merge_options(self, initial_options, options):
4746
# Make sure we have all global options carried over
48-
for attr in ['log', 'venv', 'proxy', 'venv_base', 'require_venv',
49-
'respect_venv', 'log_explicit_levels', 'log_file',
47+
for attr in ['log', 'proxy', 'require_venv',
48+
'log_explicit_levels', 'log_file',
5049
'timeout', 'default_vcs', 'skip_requirements_regex',
5150
'no_input']:
5251
setattr(options, attr, getattr(initial_options, attr) or getattr(options, attr))
@@ -73,44 +72,12 @@ def main(self, complete_args, args, initial_options):
7372

7473
self.setup_logging()
7574

76-
if options.require_venv and not options.venv:
75+
if options.require_venv:
7776
# If a venv is required check if it can really be found
7877
if not os.environ.get('VIRTUAL_ENV'):
7978
logger.fatal('Could not find an activated virtualenv (required).')
8079
sys.exit(3)
81-
# Automatically install in currently activated venv if required
82-
options.respect_venv = True
8380

84-
if args and args[-1] == '___VENV_RESTART___':
85-
## FIXME: We don't do anything this this value yet:
86-
args = args[:-2]
87-
options.venv = None
88-
else:
89-
# If given the option to respect the activated environment
90-
# check if no venv is given as a command line parameter
91-
if options.respect_venv and os.environ.get('VIRTUAL_ENV'):
92-
if options.venv and os.path.exists(options.venv):
93-
# Make sure command line venv and environmental are the same
94-
if (os.path.realpath(os.path.expanduser(options.venv)) !=
95-
os.path.realpath(os.environ.get('VIRTUAL_ENV'))):
96-
logger.fatal("Given virtualenv (%s) doesn't match "
97-
"currently activated virtualenv (%s)."
98-
% (options.venv, os.environ.get('VIRTUAL_ENV')))
99-
sys.exit(3)
100-
else:
101-
options.venv = os.environ.get('VIRTUAL_ENV')
102-
logger.info('Using already activated environment %s' % options.venv)
103-
if options.venv:
104-
logger.info('Running in environment %s' % options.venv)
105-
site_packages=False
106-
if options.site_packages:
107-
site_packages=True
108-
restart_in_venv(options.venv, options.venv_base, site_packages,
109-
complete_args)
110-
# restart_in_venv should actually never return, but for clarity...
111-
return
112-
113-
## FIXME: not sure if this sure come before or after venv restart
11481
if options.log:
11582
log_fp = open_logfile(options.log, 'a')
11683
logger.consumers.append((logger.DEBUG, log_fp))

pip/baseparser.py

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -122,42 +122,13 @@ def get_default_values(self):
122122
dest='help',
123123
action='store_true',
124124
help='Show help')
125-
parser.add_option(
126-
'-E', '--environment',
127-
dest='venv',
128-
metavar='DIR',
129-
help='virtualenv environment to run pip in (either give the '
130-
'interpreter or the environment base directory)')
131-
parser.add_option(
132-
'-s', '--enable-site-packages',
133-
dest='site_packages',
134-
action='store_true',
135-
help='Include site-packages in virtualenv if one is to be '
136-
'created. Ignored if --environment is not used or '
137-
'the virtualenv already exists.')
138-
parser.add_option(
139-
# Defines a default root directory for virtualenvs, relative
140-
# virtualenvs names/paths are considered relative to it.
141-
'--virtualenv-base',
142-
dest='venv_base',
143-
type='str',
144-
default='',
145-
help=optparse.SUPPRESS_HELP)
146125
parser.add_option(
147126
# Run only if inside a virtualenv, bail if not.
148127
'--require-virtualenv', '--require-venv',
149128
dest='require_venv',
150129
action='store_true',
151130
default=False,
152131
help=optparse.SUPPRESS_HELP)
153-
parser.add_option(
154-
# Use automatically an activated virtualenv instead of installing
155-
# globally. -E will be ignored if used.
156-
'--respect-virtualenv', '--respect-venv',
157-
dest='respect_venv',
158-
action='store_true',
159-
default=False,
160-
help=optparse.SUPPRESS_HELP)
161132

162133
parser.add_option(
163134
'-v', '--verbose',

pip/venv.py

Lines changed: 0 additions & 53 deletions
This file was deleted.

0 commit comments

Comments
 (0)