Repository navigation
Conversation
This was referenced Apr 13, 2026
zklaus
added a commit
to zklaus/pytorch
that referenced
this pull request
Apr 13, 2026
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)
ghstack-source-id: ec4e6b1
Pull-Request: pytorch#180241
zklaus
marked this pull request as ready for review
April 14, 2026 18:31
zklaus
added a commit
to zklaus/pytorch
that referenced
this pull request
Apr 15, 2026
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)
ghstack-source-id: ec4e6b1
Pull-Request: pytorch#180241
zklaus
added a commit
to zklaus/pytorch
that referenced
this pull request
Apr 17, 2026
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)
ghstack-source-id: ec4e6b1
Pull-Request: pytorch#180241
zklaus
added a commit
to zklaus/pytorch
that referenced
this pull request
Apr 29, 2026
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)
ghstack-source-id: dad9c9d
Pull-Request: pytorch#180241
zklaus
added a commit
to zklaus/pytorch
that referenced
this pull request
Apr 29, 2026
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)
ghstack-source-id: ec5c94b
Pull-Request: pytorch#180241
zklaus
added a commit
to zklaus/pytorch
that referenced
this pull request
May 1, 2026
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)
ghstack-source-id: 447112b
Pull-Request: pytorch#180241
pytorchmergebot
pushed a commit
that referenced
this pull request
May 10, 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 (#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 #180241.
Authored with Claude.
Pull Request resolved: #182120
Approved by: https://github.com/atalman
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.
Stack from ghstack (oldest at bottom):
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