Skip to content

Conversation

@cho-m
Copy link
Member

@cho-m cho-m commented Oct 26, 2025

Setuptools is pure python and an any wheel (https://pypi.org/project/setuptools/#setuptools-80.9.0-py3-none-any.whl) so it isn't Python version-specific.

Can also see from existing bottle, the contents of subdirectories are the same, e.g.

diff --recursive $(brew --prefix python-setuptools)/lib/python3.12/ $(brew --prefix python-setuptools)/lib/python3.13/echo $?
0

For now, can keep all versions as we use Setuptools in some formulae we are unable to rebuild, e.g. versioned LLVM. Can re-consider in future.

Minor reduction in size from symlinks, though not that significant as only 4.3MB with 1 Python and 12.0MB with 3 Pythons.

Copilot AI review requested due to automatic review settings October 26, 2025 16:29
@github-actions github-actions bot added the autosquash Automatically squash pull request commits according to Homebrew style. label Oct 26, 2025
@cho-m cho-m force-pushed the python-setuptool-symlink branch from 0206b14 to 76e4ae9 Compare October 26, 2025 16:30
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR optimizes the python-setuptools formula by building setuptools once with the newest Python version and creating symlinks for other supported versions, rather than building separately for each Python version. This is possible because setuptools is a pure Python package distributed as a universal wheel.

Key Changes:

  • Build setuptools once with Python 3.14 instead of building for each Python version (3.12, 3.13, 3.14)
  • Create symlinks from other Python version site-packages to the built files
  • Simplify the pythons helper method using filter_map

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@cho-m cho-m changed the title python-setuptool: build once and symlink python-setuptools: build once and symlink Oct 26, 2025
@github-actions github-actions bot added autosquash Automatically squash pull request commits according to Homebrew style. and removed autosquash Automatically squash pull request commits according to Homebrew style. labels Oct 26, 2025
@cho-m cho-m force-pushed the python-setuptool-symlink branch from f50b22f to 1a14c9e Compare October 26, 2025 16:38
@github-actions github-actions bot removed the autosquash Automatically squash pull request commits according to Homebrew style. label Oct 26, 2025
@cho-m cho-m requested a review from Copilot October 26, 2025 16:38
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@cho-m cho-m force-pushed the python-setuptool-symlink branch from 1a14c9e to 6a7e32d Compare October 26, 2025 16:41
@cho-m cho-m requested a review from Copilot October 26, 2025 16:49
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@cho-m cho-m force-pushed the python-setuptool-symlink branch from 6a7e32d to 194d8b8 Compare October 26, 2025 17:00
Copy link
Member

@branchvincent branchvincent left a comment

Choose a reason for hiding this comment

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

nice!

@github-actions
Copy link
Contributor

🤖 An automated task has requested bottles to be published to this PR.

Caution

Please do not push to this PR branch before the bottle commits have been pushed, as this results in a state that is difficult to recover from. If you need to resolve a merge conflict, please use a merge commit. Do not force-push to this PR branch.

@github-actions github-actions bot added the CI-published-bottle-commits The commits for the built bottles have been pushed to the PR branch. label Oct 26, 2025
@BrewTestBot BrewTestBot enabled auto-merge October 26, 2025 23:33
@BrewTestBot BrewTestBot added this pull request to the merge queue Oct 26, 2025
Merged via the queue into main with commit c9ad5a5 Oct 26, 2025
22 checks passed
@BrewTestBot BrewTestBot deleted the python-setuptool-symlink branch October 26, 2025 23:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI-published-bottle-commits The commits for the built bottles have been pushed to the PR branch.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants