Repository navigation
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/182120
Note: Links to docs will display an error until the docs builds have been completed. ✅ No Failures, 18 Unclassified FailuresAs of commit 2e7df7a with merge base b14e6fb ( UNCLASSIFIED FAILURES - DrCI could not classify the following jobs because the workflow did not run on the merge base. The failures may be pre-existing on trunk or introduced by this PR:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
atalman
reviewed
May 5, 2026
atalman
approved these changes
May 5, 2026
Collaborator
Author
|
@pytorchbot merge -i "Rocm failures unrelated" |
|
❌ 🤖 pytorchbot command failed: Try |
Collaborator
Author
|
@pytorchbot merge -i |
Collaborator
Collaborator
Merge failedReason: HTTP Error 504: Gateway Timeout Details for Dev Infra teamRaised by workflow job |
Collaborator
Author
|
@pytorchbot merge |
Collaborator
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Collaborator
Merge failedReason: 1 mandatory check(s) failed. The first few are: Dig deeper by viewing the failures on hud |
zklaus
force-pushed
the
replace-distutils
branch
2 times, most recently
from
May 8, 2026 12:14
7d289c4 to
5a0120e
Compare
Replace distutils.sysconfig.get_python_lib() with
sysconfig.get_path("purelib") in CI test scripts, and add a local
strtobool() to replace distutils.util.strtobool (removed in
Python 3.12).
Co-Generated with [Claude Code](https://claude.com/claude-code)
In tools/generate_torch_version.py and tools/alerts/create_alerts.py strtobool is only used as the argparse type= for boolean flags, so it is needed only on the CLI path. Importing it at module top-level forces every library consumer to have the project root on sys.path so that "from tools.strtobool import strtobool" resolves -- a constraint that is invisible to readers and easy to break under non-standard load paths (for example, loading the file via importlib.util.spec_from_file_location). Move the import inside the if __name__ == "__main__" block (or, for create_alerts.py, inside parse_args) so library imports do not depend on it. Authored by Claude.
Cover the truthy aliases, falsy aliases, and the ValueError path that the docstring promises, so future drift between this and the removed distutils.util.strtobool surfaces locally instead of as an argparse failure deep in CI. Authored by Claude.
Collaborator
|
@pytorchbot merge -i |
Collaborator
dsashidh
pushed a commit
to dsashidh/pytorch
that referenced
this pull request
May 13, 2026
## Summary
Replace deprecated `distutils` usage in CI scripts and tooling, in preparation
for Python 3.12+ (where `distutils` is removed). Two patterns are handled:
- `distutils.sysconfig.get_python_lib()` → `sysconfig.get_path("purelib")` in
`.ci/pytorch/macos-test.sh`, `.ci/pytorch/test.sh`, and
`.ci/pytorch/smoke_test/check_binary_symbols.py`.
- `distutils.util.strtobool` → a small local replacement in
`tools/strtobool.py`, imported by `.github/scripts/generate_pytorch_version.py`,
`tools/generate_torch_version.py`, and `tools/alerts/create_alerts.py`.
## Suggested review order
1. `tools/strtobool.py` — the consolidated helper, semantically identical to
the removed `distutils.util.strtobool`.
2. The three Python call sites that import it. `.github/scripts/...` uses the
same `sys.path` shim already established in
`.github/scripts/close_nonexistent_disable_issues.py` for cross-importing
from `tools/`.
3. The `sysconfig` substitutions in the shell scripts and
`check_binary_symbols.py` — mechanical.
<details>
<summary>Out of scope (intentional)</summary>
- `tools/build_pytorch_libs.py` (`distutils._msvccompiler._get_vc_env`):
deferred to a follow-up — the API is private and the replacement is not a
one-liner.
- `tools/setup_helpers/cmake.py` (`from distutils.version import LooseVersion`)
and `setup.py` (`setuptools.distutils.log.warn`): both files are deleted
outright by the scikit-build-core migration (pytorch#180248); fixing them here
would just create merge conflicts.
- `test/run_test.py:135`'s `strtobool`: deliberately permissive
(`s.lower() not in {"", "0", "false", "off"}`) and never raises. Switching
to the strict distutils-style helper would change behavior for callers
passing non-canonical truthy values such as `TEST_SHOWLOCALS=yeah`.
- Other `str2bool` variants in `benchmarks/operator_benchmark/`,
`torch/utils/hipify/`, and `.ci/lumen_cli/` do not use `distutils` and are
not in this PR's scope.
</details>
Replaces pytorch#180241.
Authored with Claude.
Pull Request resolved: pytorch#182120
Approved by: https://github.com/atalman
Alokksinha00
pushed a commit
to Alokksinha00/pytorch
that referenced
this pull request
May 15, 2026
## Summary
Replace deprecated `distutils` usage in CI scripts and tooling, in preparation
for Python 3.12+ (where `distutils` is removed). Two patterns are handled:
- `distutils.sysconfig.get_python_lib()` → `sysconfig.get_path("purelib")` in
`.ci/pytorch/macos-test.sh`, `.ci/pytorch/test.sh`, and
`.ci/pytorch/smoke_test/check_binary_symbols.py`.
- `distutils.util.strtobool` → a small local replacement in
`tools/strtobool.py`, imported by `.github/scripts/generate_pytorch_version.py`,
`tools/generate_torch_version.py`, and `tools/alerts/create_alerts.py`.
## Suggested review order
1. `tools/strtobool.py` — the consolidated helper, semantically identical to
the removed `distutils.util.strtobool`.
2. The three Python call sites that import it. `.github/scripts/...` uses the
same `sys.path` shim already established in
`.github/scripts/close_nonexistent_disable_issues.py` for cross-importing
from `tools/`.
3. The `sysconfig` substitutions in the shell scripts and
`check_binary_symbols.py` — mechanical.
<details>
<summary>Out of scope (intentional)</summary>
- `tools/build_pytorch_libs.py` (`distutils._msvccompiler._get_vc_env`):
deferred to a follow-up — the API is private and the replacement is not a
one-liner.
- `tools/setup_helpers/cmake.py` (`from distutils.version import LooseVersion`)
and `setup.py` (`setuptools.distutils.log.warn`): both files are deleted
outright by the scikit-build-core migration (pytorch#180248); fixing them here
would just create merge conflicts.
- `test/run_test.py:135`'s `strtobool`: deliberately permissive
(`s.lower() not in {"", "0", "false", "off"}`) and never raises. Switching
to the strict distutils-style helper would change behavior for callers
passing non-canonical truthy values such as `TEST_SHOWLOCALS=yeah`.
- Other `str2bool` variants in `benchmarks/operator_benchmark/`,
`torch/utils/hipify/`, and `.ci/lumen_cli/` do not use `distutils` and are
not in this PR's scope.
</details>
Replaces pytorch#180241.
Authored with Claude.
Pull Request resolved: pytorch#182120
Approved by: https://github.com/atalman
aperson30
pushed a commit
to aperson30/pytorch
that referenced
this pull request
Jun 20, 2026
## Summary
Replace deprecated `distutils` usage in CI scripts and tooling, in preparation
for Python 3.12+ (where `distutils` is removed). Two patterns are handled:
- `distutils.sysconfig.get_python_lib()` → `sysconfig.get_path("purelib")` in
`.ci/pytorch/macos-test.sh`, `.ci/pytorch/test.sh`, and
`.ci/pytorch/smoke_test/check_binary_symbols.py`.
- `distutils.util.strtobool` → a small local replacement in
`tools/strtobool.py`, imported by `.github/scripts/generate_pytorch_version.py`,
`tools/generate_torch_version.py`, and `tools/alerts/create_alerts.py`.
## Suggested review order
1. `tools/strtobool.py` — the consolidated helper, semantically identical to
the removed `distutils.util.strtobool`.
2. The three Python call sites that import it. `.github/scripts/...` uses the
same `sys.path` shim already established in
`.github/scripts/close_nonexistent_disable_issues.py` for cross-importing
from `tools/`.
3. The `sysconfig` substitutions in the shell scripts and
`check_binary_symbols.py` — mechanical.
<details>
<summary>Out of scope (intentional)</summary>
- `tools/build_pytorch_libs.py` (`distutils._msvccompiler._get_vc_env`):
deferred to a follow-up — the API is private and the replacement is not a
one-liner.
- `tools/setup_helpers/cmake.py` (`from distutils.version import LooseVersion`)
and `setup.py` (`setuptools.distutils.log.warn`): both files are deleted
outright by the scikit-build-core migration (pytorch#180248); fixing them here
would just create merge conflicts.
- `test/run_test.py:135`'s `strtobool`: deliberately permissive
(`s.lower() not in {"", "0", "false", "off"}`) and never raises. Switching
to the strict distutils-style helper would change behavior for callers
passing non-canonical truthy values such as `TEST_SHOWLOCALS=yeah`.
- Other `str2bool` variants in `benchmarks/operator_benchmark/`,
`torch/utils/hipify/`, and `.ci/lumen_cli/` do not use `distutils` and are
not in this PR's scope.
</details>
Replaces pytorch#180241.
Authored with Claude.
Pull Request resolved: pytorch#182120
Approved by: https://github.com/atalman
gplutop7
pushed a commit
to gplutop7/pytorch
that referenced
this pull request
Jul 15, 2026
## Summary
Replace deprecated `distutils` usage in CI scripts and tooling, in preparation
for Python 3.12+ (where `distutils` is removed). Two patterns are handled:
- `distutils.sysconfig.get_python_lib()` → `sysconfig.get_path("purelib")` in
`.ci/pytorch/macos-test.sh`, `.ci/pytorch/test.sh`, and
`.ci/pytorch/smoke_test/check_binary_symbols.py`.
- `distutils.util.strtobool` → a small local replacement in
`tools/strtobool.py`, imported by `.github/scripts/generate_pytorch_version.py`,
`tools/generate_torch_version.py`, and `tools/alerts/create_alerts.py`.
## Suggested review order
1. `tools/strtobool.py` — the consolidated helper, semantically identical to
the removed `distutils.util.strtobool`.
2. The three Python call sites that import it. `.github/scripts/...` uses the
same `sys.path` shim already established in
`.github/scripts/close_nonexistent_disable_issues.py` for cross-importing
from `tools/`.
3. The `sysconfig` substitutions in the shell scripts and
`check_binary_symbols.py` — mechanical.
<details>
<summary>Out of scope (intentional)</summary>
- `tools/build_pytorch_libs.py` (`distutils._msvccompiler._get_vc_env`):
deferred to a follow-up — the API is private and the replacement is not a
one-liner.
- `tools/setup_helpers/cmake.py` (`from distutils.version import LooseVersion`)
and `setup.py` (`setuptools.distutils.log.warn`): both files are deleted
outright by the scikit-build-core migration (pytorch#180248); fixing them here
would just create merge conflicts.
- `test/run_test.py:135`'s `strtobool`: deliberately permissive
(`s.lower() not in {"", "0", "false", "off"}`) and never raises. Switching
to the strict distutils-style helper would change behavior for callers
passing non-canonical truthy values such as `TEST_SHOWLOCALS=yeah`.
- Other `str2bool` variants in `benchmarks/operator_benchmark/`,
`torch/utils/hipify/`, and `.ci/lumen_cli/` do not use `distutils` and are
not in this PR's scope.
</details>
Replaces pytorch#180241.
Authored with Claude.
Pull Request resolved: pytorch#182120
Approved by: https://github.com/atalman
aws-kingrj
pushed a commit
to amazon-contributing/upstream-to-pytorch
that referenced
this pull request
Jul 29, 2026
## Summary
Replace deprecated `distutils` usage in CI scripts and tooling, in preparation
for Python 3.12+ (where `distutils` is removed). Two patterns are handled:
- `distutils.sysconfig.get_python_lib()` → `sysconfig.get_path("purelib")` in
`.ci/pytorch/macos-test.sh`, `.ci/pytorch/test.sh`, and
`.ci/pytorch/smoke_test/check_binary_symbols.py`.
- `distutils.util.strtobool` → a small local replacement in
`tools/strtobool.py`, imported by `.github/scripts/generate_pytorch_version.py`,
`tools/generate_torch_version.py`, and `tools/alerts/create_alerts.py`.
## Suggested review order
1. `tools/strtobool.py` — the consolidated helper, semantically identical to
the removed `distutils.util.strtobool`.
2. The three Python call sites that import it. `.github/scripts/...` uses the
same `sys.path` shim already established in
`.github/scripts/close_nonexistent_disable_issues.py` for cross-importing
from `tools/`.
3. The `sysconfig` substitutions in the shell scripts and
`check_binary_symbols.py` — mechanical.
<details>
<summary>Out of scope (intentional)</summary>
- `tools/build_pytorch_libs.py` (`distutils._msvccompiler._get_vc_env`):
deferred to a follow-up — the API is private and the replacement is not a
one-liner.
- `tools/setup_helpers/cmake.py` (`from distutils.version import LooseVersion`)
and `setup.py` (`setuptools.distutils.log.warn`): both files are deleted
outright by the scikit-build-core migration (pytorch#180248); fixing them here
would just create merge conflicts.
- `test/run_test.py:135`'s `strtobool`: deliberately permissive
(`s.lower() not in {"", "0", "false", "off"}`) and never raises. Switching
to the strict distutils-style helper would change behavior for callers
passing non-canonical truthy values such as `TEST_SHOWLOCALS=yeah`.
- Other `str2bool` variants in `benchmarks/operator_benchmark/`,
`torch/utils/hipify/`, and `.ci/lumen_cli/` do not use `distutils` and are
not in this PR's scope.
</details>
Replaces pytorch#180241.
Authored with Claude.
Pull Request resolved: pytorch#182120
Approved by: https://github.com/atalman
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replace deprecated
distutilsusage in CI scripts and tooling, in preparationfor Python 3.12+ (where
distutilsis removed). Two patterns are handled:distutils.sysconfig.get_python_lib()→sysconfig.get_path("purelib")in.ci/pytorch/macos-test.sh,.ci/pytorch/test.sh, and.ci/pytorch/smoke_test/check_binary_symbols.py.distutils.util.strtobool→ a small local replacement intools/strtobool.py, imported by.github/scripts/generate_pytorch_version.py,tools/generate_torch_version.py, andtools/alerts/create_alerts.py.Suggested review order
tools/strtobool.py— the consolidated helper, semantically identical tothe removed
distutils.util.strtobool..github/scripts/...uses thesame
sys.pathshim already established in.github/scripts/close_nonexistent_disable_issues.pyfor cross-importingfrom
tools/.sysconfigsubstitutions in the shell scripts andcheck_binary_symbols.py— mechanical.Out of scope (intentional)
tools/build_pytorch_libs.py(distutils._msvccompiler._get_vc_env):deferred to a follow-up — the API is private and the replacement is not a
one-liner.
tools/setup_helpers/cmake.py(from distutils.version import LooseVersion)and
setup.py(setuptools.distutils.log.warn): both files are deletedoutright by the scikit-build-core migration (Replace setup.py with a deprecation shim, remove setuptools helpers #180248); fixing them here
would just create merge conflicts.
test/run_test.py:135'sstrtobool: deliberately permissive(
s.lower() not in {"", "0", "false", "off"}) and never raises. Switchingto the strict distutils-style helper would change behavior for callers
passing non-canonical truthy values such as
TEST_SHOWLOCALS=yeah.str2boolvariants inbenchmarks/operator_benchmark/,torch/utils/hipify/, and.ci/lumen_cli/do not usedistutilsand arenot in this PR's scope.
Replaces #180241.
Authored with Claude.