Skip to content

Commit 4cb2644

Browse files
authored
Merge pull request #5576 from pypa/remove-three-flag
Remove deprecated flag --three
2 parents e8a7b45 + 21017aa commit 4cb2644

File tree

9 files changed

+18
-106
lines changed

9 files changed

+18
-106
lines changed

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,6 @@ activate a virtualenv, run `$ pipenv shell`).
144144
- A virtualenv will automatically be created, when one doesn\'t exist.
145145
- When no parameters are passed to `install`, all packages
146146
`[packages]` specified will be installed.
147-
- To initialize a virtual environment with system python3, run
148-
`$ pipenv --three`.
149147
- Otherwise, whatever virtualenv defaults to will be the default.
150148

151149
### Other Commands
@@ -198,7 +196,6 @@ Usage
198196
[env var: PIPENV_SITE_PACKAGES]
199197
--python TEXT Specify which version of Python virtualenv
200198
should use.
201-
--three Use Python 3 when creating virtualenv.
202199
--clear Clears caches (pipenv, pip). [env var:
203200
PIPENV_CLEAR]
204201
-q, --quiet Quiet mode.

docs/advanced.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,7 @@ package manager, and hence unavailable for installation into virtual
787787
environments with ``pip``. In these cases, the virtual environment can
788788
be created with access to the system ``site-packages`` directory::
789789

790-
$ pipenv --three --site-packages
790+
$ pipenv --site-packages
791791

792792
To ensure that all ``pip``-installable components actually are installed
793793
into the virtual environment and system packages are only used for
@@ -829,4 +829,4 @@ You can force Pipenv to use a different cache location by setting the environmen
829829
☤ Changing Default Python Versions
830830
----------------------------------
831831

832-
By default, Pipenv will initialize a project using whatever version of python the system has as default. Besides starting a project with the ``--python`` or ``--three`` flags, you can also use ``PIPENV_DEFAULT_PYTHON_VERSION`` to specify what version to use when starting a project when ``--python`` or ``--three`` aren't used.
832+
By default, Pipenv will initialize a project using whatever version of python the system has as default. Besides starting a project with the ``--python`` flag, you can also use ``PIPENV_DEFAULT_PYTHON_VERSION`` to specify what version to use when starting a project when ``--python`` isn't used.

docs/basics.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,6 @@ Along with the basic install command, which takes the form::
331331

332332
The user can provide these additional parameters:
333333

334-
- ``--three`` — Performs the installation in a virtualenv using the system ``python3`` link.
335334
- ``--python`` — Performs the installation in a virtualenv using the provided Python interpreter.
336335

337336
.. warning:: None of the above commands should be used together. They are also

news/5576.removal.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Remove deprecated --three flag from the CLI.

pipenv/cli/command.py

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
skip_lock_option,
2020
sync_options,
2121
system_option,
22-
three_option,
2322
uninstall_options,
2423
verbose_option,
2524
)
@@ -205,11 +204,10 @@ def cli(
205204
err=True,
206205
)
207206
ctx.abort()
208-
# --python or --three was passed...
209-
if (state.python or state.three is not None) or state.site_packages:
207+
# --python was passed...
208+
if (state.python) or state.site_packages:
210209
ensure_project(
211210
state.project,
212-
three=state.three,
213211
python=state.python,
214212
warn=True,
215213
site_packages=state.site_packages,
@@ -239,7 +237,6 @@ def install(state, **kwargs):
239237
do_install(
240238
state.project,
241239
dev=state.installstate.dev,
242-
three=state.three,
243240
python=state.python,
244241
pypi_mirror=state.pypi_mirror,
245242
system=state.system,
@@ -286,7 +283,6 @@ def uninstall(ctx, state, all_dev=False, all=False, **kwargs):
286283
state.project,
287284
packages=state.installstate.packages,
288285
editable_packages=state.installstate.editables,
289-
three=state.three,
290286
python=state.python,
291287
system=state.system,
292288
lock=not state.installstate.skip_lock,
@@ -330,7 +326,6 @@ def lock(ctx, state, **kwargs):
330326
# handled in do_lock
331327
ensure_project(
332328
state.project,
333-
three=state.three,
334329
python=state.python,
335330
pypi_mirror=state.pypi_mirror,
336331
warn=(not state.quiet),
@@ -368,7 +363,6 @@ def lock(ctx, state, **kwargs):
368363
)
369364
@argument("shell_args", nargs=-1)
370365
@pypi_mirror_option
371-
@three_option
372366
@python_option
373367
@pass_state
374368
def shell(
@@ -401,7 +395,6 @@ def shell(
401395
fancy = True
402396
do_shell(
403397
state.project,
404-
three=state.three,
405398
python=state.python,
406399
fancy=fancy,
407400
shell_args=shell_args,
@@ -425,7 +418,6 @@ def run(state, command, args):
425418
state.project,
426419
command=command,
427420
args=args,
428-
three=state.three,
429421
python=state.python,
430422
pypi_mirror=state.pypi_mirror,
431423
)
@@ -509,7 +501,6 @@ def check(
509501

510502
do_check(
511503
state.project,
512-
three=state.three,
513504
python=state.python,
514505
system=state.system,
515506
db=db,
@@ -539,7 +530,6 @@ def update(ctx, state, bare=False, dry_run=None, outdated=False, **kwargs):
539530

540531
ensure_project(
541532
state.project,
542-
three=state.three,
543533
python=state.python,
544534
pypi_mirror=state.pypi_mirror,
545535
warn=(not state.quiet),
@@ -591,7 +581,6 @@ def update(ctx, state, bare=False, dry_run=None, outdated=False, **kwargs):
591581
do_sync(
592582
state.project,
593583
dev=state.installstate.dev,
594-
three=state.three,
595584
python=state.python,
596585
bare=bare,
597586
dont_upgrade=not state.installstate.keep_outdated,
@@ -640,7 +629,6 @@ def run_open(state, module, *args, **kwargs):
640629
# Ensure that virtualenv is available.
641630
ensure_project(
642631
state.project,
643-
three=state.three,
644632
python=state.python,
645633
validate=False,
646634
pypi_mirror=state.pypi_mirror,
@@ -681,7 +669,6 @@ def sync(ctx, state, bare=False, user=False, unused=False, **kwargs):
681669
retcode = do_sync(
682670
state.project,
683671
dev=state.installstate.dev,
684-
three=state.three,
685672
python=state.python,
686673
bare=bare,
687674
dont_upgrade=(not state.installstate.keep_outdated),
@@ -704,7 +691,6 @@ def sync(ctx, state, bare=False, user=False, unused=False, **kwargs):
704691
@option("--bare", is_flag=True, default=False, help="Minimal output.")
705692
@option("--dry-run", is_flag=True, default=False, help="Just output unneeded packages.")
706693
@verbose_option
707-
@three_option
708694
@python_option
709695
@pass_state
710696
def clean(state, dry_run=False, bare=False, user=False):
@@ -713,7 +699,6 @@ def clean(state, dry_run=False, bare=False, user=False):
713699

714700
do_clean(
715701
state.project,
716-
three=state.three,
717702
python=state.python,
718703
dry_run=dry_run,
719704
system=state.system,

pipenv/cli/options.py

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
echo,
1313
make_pass_decorator,
1414
option,
15-
secho,
1615
)
1716
from pipenv.vendor.click import types as click_types
1817
from pipenv.vendor.click_didyoumean import DYMMixin
@@ -65,8 +64,6 @@ def __init__(self):
6564
self.quiet = False
6665
self.pypi_mirror = None
6766
self.python = None
68-
self.two = None
69-
self.three = None
7067
self.site_packages = None
7168
self.clear = False
7269
self.system = False
@@ -316,28 +313,6 @@ def callback(ctx, param, value):
316313
)(f)
317314

318315

319-
def three_option(f):
320-
def callback(ctx, param, value):
321-
state = ctx.ensure_object(State)
322-
if value is not None:
323-
secho(
324-
"WARNING: --three is deprecated! pipenv uses python3 by default",
325-
err=True,
326-
fg="yellow",
327-
)
328-
state.three = value
329-
return value
330-
331-
return option(
332-
"--three",
333-
is_flag=True,
334-
default=None,
335-
help="Use Python 3 when creating virtualenv. Deprecated",
336-
callback=callback,
337-
expose_value=False,
338-
)(f)
339-
340-
341316
def python_option(f):
342317
def callback(ctx, param, value):
343318
state = ctx.ensure_object(State)
@@ -562,7 +537,6 @@ def common_options(f):
562537
f = verbose_option(f)
563538
f = quiet_option(f)
564539
f = clear_option(f)
565-
f = three_option(f)
566540
f = python_option(f)
567541
return f
568542

0 commit comments

Comments
 (0)