Skip to content
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

Ranger depends is absurd (likely not just ranger) #140311

Closed
stevenwalton opened this issue Aug 23, 2023 · 4 comments
Closed

Ranger depends is absurd (likely not just ranger) #140311

stevenwalton opened this issue Aug 23, 2023 · 4 comments
Labels
bug Reproducible Homebrew/homebrew-core bug outdated PR was locked due to age

Comments

@stevenwalton
Copy link

stevenwalton commented Aug 23, 2023

The ranger formula has a depends on python 3.11 (the current most recent release which is still in its bugfix stage) but the actual program only depends are >=2.6 or >=3.1 via the official repo.

Depends should only depends on the minimal requirements. Not the newest release. The offending commit is 34b9f6 with or 114887, but even prior to this commit the root issue exists as it previously depended on python 3.10. The migration to 3.11 was only weeks after the release (Commit date: Nov 6, 2022 ; python release date: 2022-10-24) . We similarly see a quick migration to 3.10 in commit 7df794, weeks after the 3.10 release

The problem here is that the formula installs a new python version regardless of existing python on the user's system. An obvious downside is that this results in bloat, but this leads to additional problems. Issue 1499 in the ranger github is due to a user confusion about which python is being used by ranger. It is unsurprising and should not be considered user error considering a unique version of python is installed when the user has every right to believe that one of their likely several existing versions is appropriately being used. It is not user error, if users are operating under a reasonable expectation.

This leads us to several potential solutions.

The Bad Solution:

Continue as is, installing a unique version of python BUT additionally install all python dependencies, ensuring full functionality. This is bad for two reasons: first, bloat, second ranger doesn't even list all required packages. The PIL package is not in their README or requirements, so it requires homebrew maintainers to constantly checking and testing this program for full functionality.

Better Version:

We can check for environments such as anaconda, or system environments, or other python installations. This is poor because it creates a necessary specificed hierarchy.

Best Version:

Simply check the current environment's python version (i.e. which python and use that version). If a conda non-main env is found, issue a warning an prompt to continue. This is best because any issues with the formula are now shifted back to the ranger team and compatibility is reliant upon the actual software maintainers.

@stevenwalton stevenwalton added the bug Reproducible Homebrew/homebrew-core bug label Aug 23, 2023
@SMillerDev
Copy link
Member

SMillerDev commented Aug 24, 2023

Depends should only depends on the minimal requirements.

It does, it depends on python which for Homebrew means "the newest available"

Simply check the current environment's python version

Nope, Homebrew will only depend on its own formulae.

@Bo98
Copy link
Member

Bo98 commented Aug 24, 2023

Package managers generally depend on their own packages. You're probably going to struggle to find another distribution that doesn't depend on its own Python: https://repology.org/project/ranger/versions.

If you're looking to bring your own Python, then you're looking at the wrong tool - you're looking for a package manager designed to pull in dependency trees for your specific build of Python (the list of dependencies can vary between Python versions for some packages) which is what the purpose of pip is: pip install ranger-fm.

ranger doesn't even list all required packages

If pillow is required for Ranger to work like you say, then it sounds like an upstream issue because if it's not in its setup.py dependencies then pip install ranger-fm will also not work out-of-the-box on a clean Python install. I checked Debian, Fedora. FreeBSD and MacPorts and none of them list any required dependencies beyond Python itself. Arch doesn't either, but does list an optional pillow dependency, but that still requires the user to explicitly install it via pacman -S python-pillow. You can do similar with Homebrew via brew install pillow.

@Bo98 Bo98 closed this as not planned Won't fix, can't repro, duplicate, stale Aug 24, 2023
@stevenwalton
Copy link
Author

You're probably going to struggle to find another distribution that doesn't depend on its own Python

I checked Debian, Fedora. FreeBSD and MacPorts and none of them list any required dependencies beyond Python itself.

All these have dependencies on python, but they use system python. That's the issue.

Let's look at the arch package. depends=('python'), note that this is not depends=('python>=3.11'). Similarly, when we look for the depends in ubuntu, we see that it is on python3-all which is python 3.8, again, using the system python.

If you're looking to bring your own Python, then you're looking at the wrong tool

This is the issue. brew is using a unique installation of python and not the system python. I'm not looking to bring in my own python, I'm looking to use the system python. As is standard. It creates obvious user confusion AND unnecessary bloat. This is classic dependency hell.

@SMillerDev said

It does, it depends on python which for Homebrew means "the newest available"

It isn't hard to find packages that depend on python of >=3.8 but not 3.11. Are all of these wrong? You're supporting them.

The divergence from the status quo of using the system python version is resulting in user confusion. It is also likely creating maintainer confusion as one would simply expect to set the dependencies on the actual package's dependencies and then only require maintenance when the package's dependencies change. This is quite a strange burden to place on users and maintainers. Simply dismissing this with "brew uses the newest" actually requires more work while not providing any benefit to anyone.

@SMillerDev
Copy link
Member

It isn't hard to find packages that depend on python of >=3.8 but not 3.11. Are all of these wrong? You're supporting them.

That is the newest python version they work with. If it depends on python 3.8 on Homebrew it's because it failed to build with anything newer.

The divergence from the status quo of using the system python version is resulting in user confusion.

Only if you treat Homebrew as a party outside that system.

It is also likely creating maintainer confusion as one would simply expect to set the dependencies on the actual package's dependencies and then only require maintenance when the package's dependencies change.

Nope, that's not what Homebrew maintainers expect. They, unsurprisingly, know how Homebrew works.

@github-actions github-actions bot added the outdated PR was locked due to age label Sep 25, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Reproducible Homebrew/homebrew-core bug outdated PR was locked due to age
Projects
None yet
Development

No branches or pull requests

3 participants