Skip to content

Move custom build in setup.py to custom backend in _custom_build#9645

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

Move custom build in setup.py to custom backend in _custom_build#9645
aclark4life wants to merge 8 commits into
mainfrom
rip-setup-py

Conversation

@aclark4life

@aclark4life aclark4life commented Jun 1, 2026

Copy link
Copy Markdown
Member

Move C extension build logic from setup.py into
_custom_build/pillow_ext.py and update the custom backend to call pillow_ext.run().

Fixes #9643 .

Changes proposed in this pull request:

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

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

aclark4life commented Jun 1, 2026

Copy link
Copy Markdown
Member Author

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 thread _custom_build/pillow_ext.py Outdated
"Windows.",
RuntimeWarning,
)
)

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.

Is there any particular reason this was moved inside run()?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

No. I suspect it was the 🤖 's attempt to clean up after the change from executing the setup script to executing run, a function within the setup script. Unless it needs to run on import probably fine?

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.

Yep, should be fine, I just like to know why changes are made.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

OK so 👍 👍 from @radarhere and @aclark4life and still trying to convince @hugovk ? 😄

@radarhere radarhere added the Build label Jun 6, 2026
@mergify

This comment was marked as outdated.

@aclark4life aclark4life changed the title Move setup.py functionality to custom build Move custom build in setup.py to custom backend in _custom_build Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move custom build in setup.py to custom backend in _custom_build

2 participants