Pull requests / #2365
#2365 setup: honour --source on a Mac, whose hand-over skips setup.py's parser (#2363)
open · @nekomario28 · 0 comentários · No GitHub
Descrição
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.
No site
Links install, modelos, releases.