pytorch/.github
Xuehai Pan 2293fe1024 [BE][Easy] use pathlib.Path instead of dirname / ".." / pardir (#129374)
Changes by apply order:

1. Replace all `".."` and `os.pardir` usage with `os.path.dirname(...)`.
2. Replace nested `os.path.dirname(os.path.dirname(...))` call with `str(Path(...).parent.parent)`.
3. Reorder `.absolute()` ~/ `.resolve()`~ and `.parent`: always resolve the path first.

    `.parent{...}.absolute()` -> `.absolute().parent{...}`

4. Replace chained `.parent x N` with `.parents[${N - 1}]`: the code is easier to read (see 5.)

    `.parent.parent.parent.parent` -> `.parents[3]`

5. ~Replace `.parents[${N - 1}]` with `.parents[${N} - 1]`: the code is easier to read and does not introduce any runtime overhead.~

    ~`.parents[3]` -> `.parents[4 - 1]`~

6. ~Replace `.parents[2 - 1]` with `.parent.parent`: because the code is shorter and easier to read.~

Pull Request resolved: https://github.com/pytorch/pytorch/pull/129374
Approved by: https://github.com/justinchuby, https://github.com/malfet
2024-12-21 22:08:01 +00:00
..
actions [ROCm] Update setup-rocm for almalinux-based images (#143590) 2024-12-20 22:48:54 +00:00
ci_commit_pins [audio hash update] update the pinned audio hash (#143694) 2024-12-21 05:42:34 +00:00
ISSUE_TEMPLATE [ez] Make merge blocking sevs be based on label instead of string (#140636) 2024-11-14 19:02:27 +00:00
requirements Upgrade expecttest to 0.3.0 (#142869) 2024-12-11 19:04:16 +00:00
scripts [BE][Easy] use pathlib.Path instead of dirname / ".." / pardir (#129374) 2024-12-21 22:08:01 +00:00
templates [BE] Delete install sccache step from MacBB (#143512) 2024-12-19 00:41:28 +00:00
workflows [ROCm] Update setup-rocm for almalinux-based images (#143590) 2024-12-20 22:48:54 +00:00
actionlint.yaml [EZ] Remove remaining amz2023 runner variant references (#136540) 2024-09-25 19:01:00 +00:00
auto_request_review.yml
label_to_label.yml
labeler.yml Add ciflow/inductor automatically in more cases (#140824) 2024-11-15 19:54:20 +00:00
merge_rules.yaml Add DCP doc to DCP merge-rules (#139938) 2024-11-07 02:19:49 +00:00
nitpicks.yml
PULL_REQUEST_TEMPLATE.md
pytorch-circleci-labels.yml
pytorch-probot.yml Update inductor jobs to use CUDA 12.4 (#142177) 2024-12-09 16:18:38 +00:00
regenerate.sh
requirements-gha-cache.txt Remove most rockset references (#139922) 2024-11-12 21:17:43 +00:00