[PR #2365] [CLOSED] setup: honour --source on a Mac, whose hand-over skips setup.py's parser (#2363) #4007

Closed
opened 2026-11-07 15:32:24 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/2365
Author: @nekomario28
Created: 10/14/2026
Status: ❌ Closed

Base: main ← Head: setup-mac-source-flag


📝 Commits (1)

  • 4822db6 setup: honour --source on a Mac, whose hand-over skips setup.py's parser (#2363)

📊 Changes

2 files changed (+32 additions, -0 deletions)

View changed files

📝 metal/setup_mac.py (+8 -0)
📝 tools/test_setup_mac.py (+24 -0)

📄 Description

Closes #2363.

On a Mac setup.py hands over to metal/setup_mac.py before its own parser runs, so the --source flag that sets STRATA_SOURCE is never seen; setup_mac.py's parser did not define it either, so it landed in parse_known_args' leftovers and was dropped — right after the failed download had recommended it:

  [!]  not used on a Mac: --source modelscope

--source is now defined in the Mac parser and sets STRATA_SOURCE, exactly as setup.py does (choices=SOURCES, same help). The environment variable already worked on a Mac; the documented flag does now too.

Testing

python -m unittest tools.test_setup_mac — the new case drives main(["--source","modelscope","--yes","--check","--data-dir",<tmp>]) with the Mac checks mocked the way the rest of that file does (sysctl/sw_vers/xcode-select; no GPU, no network), and requires STRATA_SOURCE to be set and no not used on a Mac warning for --source.

  • With the change: 20 tests, OK.
  • With the flag definition and the os.environ line removed: AssertionError: None != 'modelscope'.

The other tools/test_setup_*.py modules behave as before (test_setup_engine_hash and test_setup_golden fail identically in this checkout without this change).

The hand-over itself is untouched: the Mac parser still owns the Mac argv, it just knows this one flag now.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/2365 **Author:** [@nekomario28](https://github.com/nekomario28) **Created:** 10/14/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `setup-mac-source-flag` --- ### 📝 Commits (1) - [`4822db6`](https://github.com/Niko1221/Strata/commit/4822db63a506e9ca592df243be852982bb473e40) setup: honour --source on a Mac, whose hand-over skips setup.py's parser (#2363) ### 📊 Changes **2 files changed** (+32 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `metal/setup_mac.py` (+8 -0) 📝 `tools/test_setup_mac.py` (+24 -0) </details> ### 📄 Description Closes #2363. On a Mac `setup.py` hands over to `metal/setup_mac.py` before its own parser runs, so the `--source` flag that sets `STRATA_SOURCE` is never seen; `setup_mac.py`'s parser did not define it either, so it landed in `parse_known_args`' leftovers and was dropped — right after the failed download had recommended it: ``` [!] not used on a Mac: --source modelscope ``` `--source` is now defined in the Mac parser and sets `STRATA_SOURCE`, exactly as `setup.py` does (`choices=SOURCES`, same help). The environment variable already worked on a Mac; the documented flag does now too. ## Testing `python -m unittest tools.test_setup_mac` — the new case drives `main(["--source","modelscope","--yes","--check","--data-dir",<tmp>])` with the Mac checks mocked the way the rest of that file does (sysctl/sw_vers/xcode-select; no GPU, no network), and requires `STRATA_SOURCE` to be set **and** no `not used on a Mac` warning for `--source`. - With the change: 20 tests, `OK`. - With the flag definition and the `os.environ` line removed: `AssertionError: None != 'modelscope'`. The other `tools/test_setup_*.py` modules behave as before (`test_setup_engine_hash` and `test_setup_golden` fail identically in this checkout without this change). The hand-over itself is untouched: the Mac parser still owns the Mac argv, it just knows this one flag now. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:32:24 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#4007
No description provided.