From cd8dc79537e8bffe379a643d202a27227e7f16f9 Mon Sep 17 00:00:00 2001 From: johnthagen Date: Wed, 27 Jul 2022 21:05:00 -0400 Subject: [PATCH 1/4] Add short -nr alias for --no-reuse-existing-virtualenvs --- nox/_option_set.py | 2 +- nox/_options.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/nox/_option_set.py b/nox/_option_set.py index 0ffcc9d9..26014117 100644 --- a/nox/_option_set.py +++ b/nox/_option_set.py @@ -160,7 +160,7 @@ def flag_pair_merge_func( def make_flag_pair( name: str, enable_flags: tuple[str, str] | tuple[str], - disable_flags: tuple[str], + disable_flags: tuple[str, str] | tuple[str], default: bool = False, **kwargs: Any, ) -> tuple[Option, Option]: diff --git a/nox/_options.py b/nox/_options.py index 4f6b3ad7..d1a6bb78 100644 --- a/nox/_options.py +++ b/nox/_options.py @@ -363,7 +363,7 @@ def _session_completer( *_option_set.make_flag_pair( "reuse_existing_virtualenvs", ("-r", "--reuse-existing-virtualenvs"), - ("--no-reuse-existing-virtualenvs",), + ("-nr", "--no-reuse-existing-virtualenvs",), group=options.groups["environment"], help="Re-use existing virtualenvs instead of recreating them.", ), From a11bd6d86a7db5dc8fd493cc488c870a2379e7c3 Mon Sep 17 00:00:00 2001 From: johnthagen Date: Wed, 27 Jul 2022 21:10:42 -0400 Subject: [PATCH 2/4] Run black --- nox/_options.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nox/_options.py b/nox/_options.py index d1a6bb78..59b11483 100644 --- a/nox/_options.py +++ b/nox/_options.py @@ -363,7 +363,10 @@ def _session_completer( *_option_set.make_flag_pair( "reuse_existing_virtualenvs", ("-r", "--reuse-existing-virtualenvs"), - ("-nr", "--no-reuse-existing-virtualenvs",), + ( + "-nr", + "--no-reuse-existing-virtualenvs", + ), group=options.groups["environment"], help="Re-use existing virtualenvs instead of recreating them.", ), From ff27c46fc23b9010f20514e714e3c766d564f480 Mon Sep 17 00:00:00 2001 From: johnthagen Date: Thu, 4 Aug 2022 15:07:04 -0400 Subject: [PATCH 3/4] Change short command to -N --- nox/_options.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nox/_options.py b/nox/_options.py index 59b11483..628318f6 100644 --- a/nox/_options.py +++ b/nox/_options.py @@ -364,7 +364,7 @@ def _session_completer( "reuse_existing_virtualenvs", ("-r", "--reuse-existing-virtualenvs"), ( - "-nr", + "-R", "--no-reuse-existing-virtualenvs", ), group=options.groups["environment"], From 629dda275a811bb43206a581b52b48582630af2c Mon Sep 17 00:00:00 2001 From: johnthagen Date: Thu, 4 Aug 2022 15:09:21 -0400 Subject: [PATCH 4/4] Fix shortcut --- nox/_options.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nox/_options.py b/nox/_options.py index 628318f6..4129c32d 100644 --- a/nox/_options.py +++ b/nox/_options.py @@ -364,7 +364,7 @@ def _session_completer( "reuse_existing_virtualenvs", ("-r", "--reuse-existing-virtualenvs"), ( - "-R", + "-N", "--no-reuse-existing-virtualenvs", ), group=options.groups["environment"],