Skip to content

[release/2.11] Pass extension sources as str, not pathlib.Path#4210

Closed
ethanwee1 wants to merge 1 commit into
pytorch:release/2.11from
ethanwee1:test-ext-sources-str-2.11
Closed

[release/2.11] Pass extension sources as str, not pathlib.Path#4210
ethanwee1 wants to merge 1 commit into
pytorch:release/2.11from
ethanwee1:test-ext-sources-str-2.11

Conversation

@ethanwee1

Copy link
Copy Markdown

Why

get_ext_modules() builds the extension sources lists from _CSRC_DIR / "...", i.e. pathlib.Path objects. Older setuptools accepted os.PathLike, but newer setuptools/distutils now asserts that sources is a list of str:

File ".../tools/setup_helpers/extension.py", line 106, in get_ext_modules
    extension(
  ...
  File ".../setuptools/_distutils/extension.py", line 110, in __init__
    raise AssertionError("'sources' must be a list of strings")
AssertionError: 'sources' must be a list of strings

This breaks python setup.py bdist_wheel with a sufficiently new setuptools.

Fix

Wrap each source path in str() in the three extension(sources=...) lists. include_dirs are left unchanged (distutils does not assert on them).

get_ext_modules() built the CppExtension/CUDAExtension `sources` lists
from `_CSRC_DIR / "..."`, i.e. pathlib.Path objects. Newer
setuptools/distutils enforces that `sources` is a list of str and now
raises:

    AssertionError: 'sources' must be a list of strings

which breaks `setup.py bdist_wheel`. Wrap each source path in str() so
the list contains plain strings. include_dirs are left as-is (distutils
does not assert on them).
@pytorch-bot

pytorch-bot Bot commented Jul 23, 2026

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/audio/4210

Note: Links to docs will display an error until the docs builds have been completed.

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla

meta-cla Bot commented Jul 23, 2026

Copy link
Copy Markdown

Hi @ethanwee1!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@ethanwee1

Copy link
Copy Markdown
Author

Closing — for ROCm release/2.11 the fix will land in ROCm/audio (see ROCm#19) and the wheel pipeline's related_commits will point at ROCm/audio, not pytorch/audio.

@ethanwee1 ethanwee1 closed this Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant