ByteDance-Seed / ByteDance-Seed/Triton-distributed
setup.py fails to recognize repository checkouts
- Dominant language
- Python
- Stars
- 1.5k
- Forks
- 172
- PR merge metrics
- No merged PRs in 30d
Description
### Description
`python/setup.py:is_git_repo()` checks `Path(__file__).parent / ".git"`. Because `setup.py` lives under `python/`, this tests `python/.git` rather than the repository root.
At current main commit `8260bc34398c2b8f36dc840fd22f741ca9294584`, the check returns `False` in a normal checkout even though the root `.git` directory exists.
### Reproduction
Evaluating the relevant setup helpers from the fixed checkout gives:
```text
is_git_repo() = False
get_git_version_suffix() = ''
git rev-parse --short=8 HEAD = 8260bc34
```
### Impact
- development builds omit the intended `+git` version suffix
- `BackendInstaller.prepare()` skips its source-checkout submodule preparation branch
### Expected behavior
The helper should recognize the repository root one directory above `python/`. The check should also accept a `.git` file so linked worktrees are recognized.
Contributor guide
Research direction
Start in python/setup.py with is_git_repo() and get_git_version_suffix(), then inspect how BackendInstaller.prepare() uses the checkout check. Reproduce the reported helper results in a normal checkout, including the git rev-parse command. Done means the repository root one directory above python/ is recognized for both .git directories and files, so the version suffix and checkout preparation branch are no longer skipped.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, python
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 84/100