Skip to content

Commit 47cb9c3

Browse files
authored
fix: ignore default selection for tags and keywords (#1057)
Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
1 parent 63dcab9 commit 47cb9c3

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

nox/tasks.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -197,16 +197,17 @@ def filter_manifest(manifest: Manifest, global_config: Namespace) -> Manifest |
197197
# Filter by the name of any explicit sessions.
198198
# This can raise KeyError if a specified session does not exist;
199199
# log this if it happens. The sessions does not come from the Noxfile
200-
# if keywords is not empty.
201-
if global_config.sessions is None:
202-
manifest.filter_by_default()
203-
else:
204-
try:
205-
manifest.filter_by_name(global_config.sessions)
206-
except KeyError as exc:
207-
logger.error("Error while collecting sessions.")
208-
logger.error(exc.args[0])
209-
return 3
200+
# if keywords is not empty or tags are supplied.
201+
if global_config.tags is None and not global_config.keywords:
202+
if global_config.sessions is None:
203+
manifest.filter_by_default()
204+
else:
205+
try:
206+
manifest.filter_by_name(global_config.sessions)
207+
except KeyError as exc:
208+
logger.error("Error while collecting sessions.")
209+
logger.error(exc.args[0])
210+
return 3
210211

211212
if not manifest and not global_config.list_sessions:
212213
print("No sessions selected. Please select a session with -s <session name>.\n")

noxfile.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ def _check_python_version(session: nox.Session) -> None:
193193
"3.14t",
194194
],
195195
default=False,
196+
tags=["gha"],
196197
)
197198
def github_actions_default_tests(session: nox.Session) -> None:
198199
"""Check default versions installed by the nox GHA Action"""
@@ -208,6 +209,7 @@ def github_actions_default_tests(session: nox.Session) -> None:
208209
"pypy3.11",
209210
],
210211
default=False,
212+
tags=["gha"],
211213
)
212214
def github_actions_all_tests(session: nox.Session) -> None:
213215
"""Check all versions installed by the nox GHA Action"""

0 commit comments

Comments
 (0)