unsloth/unsloth_cli/tests
Daniel Han 6254ab37c3
Studio: accept --not-secure as a back-compat alias for --no-secure (#6568)
* Studio: accept --not-secure as a back-compat alias for --no-secure

PR #6560 renamed the negative secure flag from --not-secure to --no-secure
to match argparse.BooleanOptionalAction. Re-add --not-secure as a hidden,
deprecated alias at both CLI layers so existing scripts and muscle memory
keep working, while --no-secure stays the documented spelling.

- studio/backend/run.py: extract the CLI parser into _build_arg_parser() so
  the flag wiring is unit-testable, and register --not-secure as a hidden
  store_false alias for --no-secure. Last flag wins, matching
  BooleanOptionalAction semantics.
- unsloth_cli/commands/studio.py: add a hidden --not-secure option to
  `unsloth studio` and `unsloth studio run`; it forces secure off and
  forwards the canonical --no-secure to the backend.
- Tests at both layers for the alias and its polarity.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Studio: address review on --not-secure alias

- run.py: use argparse.SUPPRESS for the --not-secure default so the alias
  never contributes a namespace default (the canonical --secure owns it).
- studio.py: resolve --not-secure last-wins from argv via _resolve_secure()
  so `--not-secure --secure` keeps secure on, matching the backend's
  BooleanOptionalAction and how --secure/--no-secure already behave.
- Add a CLI last-wins test covering both flag orders.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-06-22 07:20:50 -07:00
..
test_connect.py CLI: stop unsloth connect from leaking Studio credentials to unverified servers (#6479) 2026-06-21 21:28:38 -07:00
test_inference_chat.py CLI: stop unsloth connect from leaking Studio credentials to unverified servers (#6479) 2026-06-21 21:28:38 -07:00
test_studio_cloudflare_flag.py Studio: enable stdio MCP servers on a loopback bind (#6295) 2026-06-15 03:02:32 +01:00
test_studio_run_parallel_flag.py fix(studio): load run.py by path for editable installs (#5909) 2026-06-12 00:11:05 -07:00
test_studio_run_short_alias_clashes.py Reduce and tighten code comments and docstrings repo-wide (#6095) 2026-06-08 23:09:51 -07:00
test_studio_secure_flag.py Studio: accept --not-secure as a back-compat alias for --no-secure (#6568) 2026-06-22 07:20:50 -07:00
test_studio_verbose_flag.py Studio: trim serving-log noise and surface llama-server engine stats (#6377) 2026-06-17 05:37:57 -07:00