-
-
Notifications
You must be signed in to change notification settings - Fork 12.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[rfc] Homebrew packaging for python resources #157500
Comments
Thanks @chenrui333 for opening this issue. I have been thinking about this topic in the past, and my opinion is currently:
I can think of two clear policies:
|
It'd be good to measure how times change before/after moving to separate formulae. Unless there's non-trivial, measurable improvements: things should not be extracted for this reason 👎🏻
Reducing duplication only really makes sense if there's a non-trivial process to install a resource which usually does not seem to be the case. Caching is already efficient/shared when multiple formulae or resources share the same URL so I don't think caching makes sense 👎🏻.
This, and other non-trivial native compilation, seems like a very good fit for separate formulae 👍🏻
I don't understand what this means for resources, can you elaborate?
This is not a concern for applications but is a large concern for libraries.
Can you elaborate on this? Not sure I understand.
This is probably a good argument for all Python libraries, except bindings, to be always keg-only.
I would rather we didn't do this because it would be a large departure from how we've done things and do things for every other language, really.
This has a build-time rust dependency so 👍🏻 to keep it as a formula.
This has no non-Python build dependencies and the installation is very simple so 👎🏻, it should not be a formula.
I think we should figure out a criteria and then revert all Python formulae that do not fit that.
Agreed 👍🏻
This has been amended recently but we can amend it further if needed. |
According to this reasoning, we should also remove the |
It may be up for removal once we finalize the criteria of valid python formulae. Some notes on
|
Yes, sounds like it's worth removal. |
|
We should start removing |
In the case of six, I wonder if our resource updater fails if resources that aren't needed are excluded, because without that we would never know if it was no longer required. |
I think there are many questions to answer here, I won't be able to respond to everything in one message. Regarding Regarding the brew link issue: this is always going to happen with a shared I am wondering if we should introduce a second brew-specific If I understand the problem well, there should be no issue for our users if they had used |
That might be a solution, but in that case what are we packaging them for if not for users. |
Only for our internal use. Most formulae are command line tools, and the user should not care if it's written in Python or with something else. My approach is of course a little bit more drastic compared to the rules we had in place before. And maybe this change will imply getting rid of a few formulae too (through a deprecation cycle) to comply with those new rules. It's unclear though if we want to go in that direction, but I feel that mixing pip stuff with brewed stuff is going to bring endless odd bugs and issues. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
Not stale, I believe. |
I think this kinda is stale. We're at the point now that at the AGM this should be decided and then turned into docs/PRs. |
A summary of one of the AGM ideas we discussed: instead of separating things into new formulae like |
This was a fun idea and I really liked it. I'm keeping this in a corner of my head just in case we need to revive the idea. But given the discussion we had together at the AGM, and the different scenarios we explored together: we are not going to do this. It's too complex and needs too many changes in brew. I'll write down what we "decided" in the next message so we can review it. |
After a small workshop at the AGM here is what we came up with @woodruffw and @cho-m (and others):
One last thing: we did not discuss renaming packages to add consistency (python-cryptography vs numpy for example). |
👍🏻 to all of these in particular. Let's move forward with this. Thanks for shepherding @iMichka! |
We added a patched/modified The alternative would be to add |
Yes, this type of usage seems reasonable 👍🏻 |
Something I'm missing from this discussion (and, in fact, missing period) is how this (quite breaking!) transition is communicated to the user. I've been hit several times by a package I rely on simply vanishing without explanation and having to dig through the repo here. While I understand the rationale and accept the change, I would have expected a |
...anything? 🦗 |
@clason I'm not sure what response you were expecting here, can you elaborate a bit more specifically what you're asking for? If you're suggesting Homebrew change something: the best way of making that happening is to open a pull request. This document should help and we're happy to walk you through anything else. Thanks! |
I am asking for explanation and public documentation of the already decided and in-progress Great Python Yeetening. This is project management level and not something a random contributor (who was not involved in this decision) can or should do. |
Homebrew employs exactly 0 project managers, so I think it'll be up to the people who want some documentation to add some documentation. |
This issue is the closest thing we have to documentation right now.
It is definitely something a random contributor can do. If you don't want to do it: that's ok, though it may mean it does not get done. |
Whether you call them "project managers" or "maintainers" or "core members" or "AGM" (whatever that is) doesn't really matter; someone has decided to go through with this and merge the corresponding PRs.
It is not, since if I knew, I wouldn't be asking. What are people supposed(!) to do now if they, e.g., want to have sympy in their general environment and The PR description still has a lot of question marks and todos. Basically, I am wondering why this process is going on while this is still marked as RFC and open. |
#157500 (comment) captures the overall scope of the changes here, and effectively "closes" the RFC part of the issue. AFAIK, the reason the issue is still open is so that we can continue to discuss any special cases, e.g. with Re: default environments: could you give us a sense of the packages you're expecting to be Homebrew-managed vs. |
Any list will be personal, I'm afraid, so unlikely to give a good general case. (If you ask me, the "Big Four" are Numpy, Scipy, Matplotlib, and Sympy, and I would expect being able to install these at the very least. But others would insist on pandas being there, or others.) (Sympy integrates with ipython which is still shipped, so that would be another argument for keeping it as a leaf package.) But my general point remains:
|
It's okay for it to be a personal list, but thanks -- this helps. We're currently discussing a better qualification system for this sort of thing, since we don't want to break the "entirely Homebrew-managed scientific workbench" use case. I will look into improving the documentation here when I have a free moment, although I'm not sure if it'll be straightforward to print a |
Added note at top of issue to point corresponding comment. I've pinned and closed issue to keep it visible but also align status. Can continue discussing details further here. I also have a tracking issue #167905 if anyone wants to see any per-formula decisions. |
EDIT: See #157500 (comment) for final decision.
Homebrew packaging for python resources
Context
In light of recent discussions, there's a growing concern regarding the separation of Python resources into distinct Homebrew formulae. A key consideration is avoiding the duplication of efforts, particularly for packages readily installable via pip install. Additionally, there's a potential issue of brew link errors, especially with Python 3.11 formulae (py3.10 support was removed recently). This document aims to collate various ideas and lay a foundation for the management of Python formulae in Homebrew.
Problem Statement
The current approach to handling Python resources in Homebrew has led to several challenges:
Extended Build Times: many Python formulae (like dvc, dstack, semgrep) have extensive resource lists, leading to prolonged build times.
Security Vulnerabilities: While there are critical CVE issues, we also leverage pip-audit to monitor and update resources for security vulnerabilities, necessitating frequent revision bumps.
Resource Sharing: Several resources are extensively shared across homebrew-core. Isolating these resources into individual formulae could reduce duplications and enhance caching efficiency (like cffi, six, pygments, python-cryptography)
Rust build dependencies: Some formulae, like python-cryptography have rust dependency. Moving them to separate formulae would remove the need of rust for build dependency. (like python-cryptography)
Default Python Version Update: Homebrew aligns with the annual release cycle of Python, updating bottles to support new major versions each year. Once the migration to the latest major Python version is complete, the default Python version in Homebrew will be updated to reflect the most recent Python 3 release.
Challenges
Our goal is to optimize Python package management in Homebrew without replicating the functionality of existing Python package repositories. Key challenges include:
Avoiding redundancy with pip install for easily installable packages.
Ensuring version compatibility across different formulae.
Brew link errors, eg. https://github.com/orgs/Homebrew/discussions/4975
Naming Conventions
Historically, Homebrew wasusing language-agnostic approach for the python libraries, like cffi, six, but homebrew python libraries are not necessarily for end-users, so it might be better to use `python-*` prefix instead of language agnostic namings. But it is also noted that many python libraries also ship the CLI tools, we did add caveats to clarify the python dependencies.
Proposed Solutions and Discussion
This section will invite suggestions and discuss potential strategies to address the outlined challenges, aiming for efficient, secure, and user-friendly management of Python resources in Homebrew.
Popular formula
This category is trying to include the formulae which are considered popular within the homebrew-core project and keep them for build efficiencies.
Formulae for python builds
Maybe combine common extensions into these formulae? For example, the python-setuptools formula could include both the “setuptools” and “setuptools-scm” Python modules, and the python-hatchling formula could include “hatchling”, “hatch-vcs”, and “hatch-fancy-pypi-readme” Python modules.
Decision
Revert some existing python-* formulae
For formulae that do not require much build efforts and are only used by few formulae, we are going to deprecate/remove them from the homebrew-core repo.
The text was updated successfully, but these errors were encountered: