Skip to content

Move setup.py functionality to custom build#9645

Open
aclark4life wants to merge 2 commits into
mainfrom
rip-setup-py
Open

Move setup.py functionality to custom build#9645
aclark4life wants to merge 2 commits into
mainfrom
rip-setup-py

Conversation

@aclark4life
Copy link
Copy Markdown
Member

Move C extension build logic from setup.py into
_custom_build/pillow_ext.py and update the custom build backend to call pillow_ext.run() directly, eliminating the need for an executable setup.py script.

Fixes #9643 .

Changes proposed in this pull request:

  • Move the remaining custom build in setup.py to our custom build.

Move C extension build logic from setup.py into
_custom_build/pillow_ext.py and update the custom build
backend to call pillow_ext.run() directly, eliminating
the need for an executable setup.py script.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@aclark4life aclark4life changed the title Convert setup.py to pyproject.toml Move setup.py functionality to custom build Jun 1, 2026
@aclark4life aclark4life added the 🤖-assisted AI-assisted label Jun 1, 2026
@aclark4life aclark4life changed the title Move setup.py functionality to custom build Move setup.py functionality to custom build Jun 1, 2026
@radarhere
Copy link
Copy Markdown
Member

For some background - the custom backend was added in #7171, as a workaround for pypa/setuptools#2491. I had hoped that setuptools would one day resolve their issue, and the custom backend could be removed. But this PR is investing in it further.

What is the advantage of using a custom backend over setup.py? It doesn't appear that setup.py itself is problematic.

@aclark4life
Copy link
Copy Markdown
Member Author

aclark4life commented Jun 1, 2026

What is the advantage of using a custom backend over setup.py? It doesn't appear that setup.py itself is problematic.

True, it's only cosmetic. I would prefer to not see setup.py anymore because it's confusing, but not urgent.

Comment on lines +1070 to +1072
f"{sys.version_info.major}.{sys.version_info.minor} and does not provide "
"prebuilt Windows binaries. We do not recommend building from source on "
"Windows.",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
f"{sys.version_info.major}.{sys.version_info.minor} and does not provide "
"prebuilt Windows binaries. We do not recommend building from source on "
"Windows.",
f"{sys.version_info.major}.{sys.version_info.minor} and does not "
"provide prebuilt Windows binaries. We do not recommend building from "
"source on Windows.",

Lint fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🤖-assisted AI-assisted

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move setup.py functionality to custom build

2 participants