Skip to content

Commit

Permalink
Remove deprecated flag --three
Browse files Browse the repository at this point in the history
  • Loading branch information
oz123 committed Jan 23, 2023
1 parent e8a7b45 commit fe99aa1
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 106 deletions.
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,6 @@ activate a virtualenv, run `$ pipenv shell`).
- A virtualenv will automatically be created, when one doesn\'t exist.
- When no parameters are passed to `install`, all packages
`[packages]` specified will be installed.
- To initialize a virtual environment with system python3, run
`$ pipenv --three`.
- Otherwise, whatever virtualenv defaults to will be the default.

### Other Commands
Expand Down Expand Up @@ -198,7 +196,6 @@ Usage
[env var: PIPENV_SITE_PACKAGES]
--python TEXT Specify which version of Python virtualenv
should use.
--three Use Python 3 when creating virtualenv.
--clear Clears caches (pipenv, pip). [env var:
PIPENV_CLEAR]
-q, --quiet Quiet mode.
Expand Down
4 changes: 2 additions & 2 deletions docs/advanced.rst
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,7 @@ package manager, and hence unavailable for installation into virtual
environments with ``pip``. In these cases, the virtual environment can
be created with access to the system ``site-packages`` directory::

$ pipenv --three --site-packages
$ pipenv --site-packages

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

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.
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.
1 change: 0 additions & 1 deletion docs/basics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,6 @@ Along with the basic install command, which takes the form::

The user can provide these additional parameters:

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

.. warning:: None of the above commands should be used together. They are also
Expand Down
19 changes: 2 additions & 17 deletions pipenv/cli/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
skip_lock_option,
sync_options,
system_option,
three_option,
uninstall_options,
verbose_option,
)
Expand Down Expand Up @@ -205,11 +204,10 @@ def cli(
err=True,
)
ctx.abort()
# --python or --three was passed...
if (state.python or state.three is not None) or state.site_packages:
# --python was passed...
if (state.python) or state.site_packages:
ensure_project(
state.project,
three=state.three,
python=state.python,
warn=True,
site_packages=state.site_packages,
Expand Down Expand Up @@ -239,7 +237,6 @@ def install(state, **kwargs):
do_install(
state.project,
dev=state.installstate.dev,
three=state.three,
python=state.python,
pypi_mirror=state.pypi_mirror,
system=state.system,
Expand Down Expand Up @@ -286,7 +283,6 @@ def uninstall(ctx, state, all_dev=False, all=False, **kwargs):
state.project,
packages=state.installstate.packages,
editable_packages=state.installstate.editables,
three=state.three,
python=state.python,
system=state.system,
lock=not state.installstate.skip_lock,
Expand Down Expand Up @@ -330,7 +326,6 @@ def lock(ctx, state, **kwargs):
# handled in do_lock
ensure_project(
state.project,
three=state.three,
python=state.python,
pypi_mirror=state.pypi_mirror,
warn=(not state.quiet),
Expand Down Expand Up @@ -368,7 +363,6 @@ def lock(ctx, state, **kwargs):
)
@argument("shell_args", nargs=-1)
@pypi_mirror_option
@three_option
@python_option
@pass_state
def shell(
Expand Down Expand Up @@ -401,7 +395,6 @@ def shell(
fancy = True
do_shell(
state.project,
three=state.three,
python=state.python,
fancy=fancy,
shell_args=shell_args,
Expand All @@ -425,7 +418,6 @@ def run(state, command, args):
state.project,
command=command,
args=args,
three=state.three,
python=state.python,
pypi_mirror=state.pypi_mirror,
)
Expand Down Expand Up @@ -509,7 +501,6 @@ def check(

do_check(
state.project,
three=state.three,
python=state.python,
system=state.system,
db=db,
Expand Down Expand Up @@ -539,7 +530,6 @@ def update(ctx, state, bare=False, dry_run=None, outdated=False, **kwargs):

ensure_project(
state.project,
three=state.three,
python=state.python,
pypi_mirror=state.pypi_mirror,
warn=(not state.quiet),
Expand Down Expand Up @@ -591,7 +581,6 @@ def update(ctx, state, bare=False, dry_run=None, outdated=False, **kwargs):
do_sync(
state.project,
dev=state.installstate.dev,
three=state.three,
python=state.python,
bare=bare,
dont_upgrade=not state.installstate.keep_outdated,
Expand Down Expand Up @@ -640,7 +629,6 @@ def run_open(state, module, *args, **kwargs):
# Ensure that virtualenv is available.
ensure_project(
state.project,
three=state.three,
python=state.python,
validate=False,
pypi_mirror=state.pypi_mirror,
Expand Down Expand Up @@ -681,7 +669,6 @@ def sync(ctx, state, bare=False, user=False, unused=False, **kwargs):
retcode = do_sync(
state.project,
dev=state.installstate.dev,
three=state.three,
python=state.python,
bare=bare,
dont_upgrade=(not state.installstate.keep_outdated),
Expand All @@ -704,7 +691,6 @@ def sync(ctx, state, bare=False, user=False, unused=False, **kwargs):
@option("--bare", is_flag=True, default=False, help="Minimal output.")
@option("--dry-run", is_flag=True, default=False, help="Just output unneeded packages.")
@verbose_option
@three_option
@python_option
@pass_state
def clean(state, dry_run=False, bare=False, user=False):
Expand All @@ -713,7 +699,6 @@ def clean(state, dry_run=False, bare=False, user=False):

do_clean(
state.project,
three=state.three,
python=state.python,
dry_run=dry_run,
system=state.system,
Expand Down
26 changes: 0 additions & 26 deletions pipenv/cli/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
echo,
make_pass_decorator,
option,
secho,
)
from pipenv.vendor.click import types as click_types
from pipenv.vendor.click_didyoumean import DYMMixin
Expand Down Expand Up @@ -65,8 +64,6 @@ def __init__(self):
self.quiet = False
self.pypi_mirror = None
self.python = None
self.two = None
self.three = None
self.site_packages = None
self.clear = False
self.system = False
Expand Down Expand Up @@ -316,28 +313,6 @@ def callback(ctx, param, value):
)(f)


def three_option(f):
def callback(ctx, param, value):
state = ctx.ensure_object(State)
if value is not None:
secho(
"WARNING: --three is deprecated! pipenv uses python3 by default",
err=True,
fg="yellow",
)
state.three = value
return value

return option(
"--three",
is_flag=True,
default=None,
help="Use Python 3 when creating virtualenv. Deprecated",
callback=callback,
expose_value=False,
)(f)


def python_option(f):
def callback(ctx, param, value):
state = ctx.ensure_object(State)
Expand Down Expand Up @@ -562,7 +537,6 @@ def common_options(f):
f = verbose_option(f)
f = quiet_option(f)
f = clear_option(f)
f = three_option(f)
f = python_option(f)
return f

Expand Down
Loading

0 comments on commit fe99aa1

Please sign in to comment.