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

Reconsider player library dependencies for non-PyPI installations #62

Open
xgi opened this issue Nov 11, 2019 · 3 comments
Open

Reconsider player library dependencies for non-PyPI installations #62

xgi opened this issue Nov 11, 2019 · 3 comments

Comments

@xgi
Copy link
Owner

xgi commented Nov 11, 2019

First of all, I do consider it to be an issue if users would have to install the binaries for every player that castero supports (mpv, vlc, potentially more). However, it is important to clarify that there is a difference between the Python libraries which I use to interact with these applications, and the applications themselves. castero can run and work perfectly fine with just one of these players installed; I don't personally have vlc on my system, except when I'm using it for testing.

At this point I'd like to say that the only "officially supported" way to install castero is with pip, which is partly for this reason. When you install castero with pip, it does require that the libraries used to interact with the players are installed. This is mostly a convenience thing, because these libraries themselves are very small and having them all downloaded by default means the user doesn't have to manually install these libraries if they decide to separately install vlc and change their config to use that instead.

The issue comes with package managers, which have their own dependency chains. The castero AUR package, which I do not maintain, defines python-vlc (the small Python library) as a dependency. Installing that package, however, does require you to download vlc. Which I agree is problematic for users who don't want to install vlc (myself included).

I'm not sure the best solution to this. The main concern I have with making all of the libraries optional is that it adds an additional step to the castero installation process, which is to manually install some other library to actually use the client (and you'd also have to do that if you ever want to switch players). I could potentially have a prompt either on first-run or if no players were detected to tell the user to go install one. But again, I really don't like increasing the friction from installing castero to actually using it.

Originally posted by @rien333 in #29 (comment)

@rien333
Copy link

rien333 commented Nov 11, 2019

All right, makes sense now. I got the sense from the AUR maintainers that they couldn't help it, but the situation is a little more complex.

@rien333
Copy link

rien333 commented Nov 11, 2019

Quick sidenote/possible tip for other users: I edited the PKGBUILD to remove python-vlc from the depends=(...) list. Builds fine, but obviously fails to run with pkg_resources.DistributionNotFound: The 'python-vlc' distribution was not found. Then I installed python-vlc through pip, which does not pull VLC.

The odd thing is, the python-vlc page says that "it relies on an already present install of VLC". However, I don't have VLC installed, yet it runs fine, so the the disclaimer doesn't seem to be the case for castero.

@rien333
Copy link

rien333 commented Nov 11, 2019

I'm not sure the best solution to this. The main concern I have with making all of the libraries optional is that it adds an additional step to the castero installation process, which is to manually install some other library to actually use the client (and you'd also have to do that if you ever want to switch players).

I doubt I know more about the python packaging process than you do (so I'm sorry if I'm just telling you obvious stuff), but there is definitely a way to do "either/or" dependencies. Given this possibility, you could then define an optional switch that can be used during python setup.py install [--mpv-only/--vlc-only] for package maintainers to use only VLC or mpv, while installing both python-vlc and python-mpv by default. So in the default case, say per the official pip route, both libraries will be pulled. But when installing from a package manager, the package manager can decide to only "build" with support for one library and player (or both when both are present).

I'm not sure if a cli switch is the best way to instruct the setup.py script to do stuff, but I suppose you could come up with other detection mechanisms (environment variables?).

Of course, there remains the possibility that the user switches video players. However, this will be rare, and in the case that a required library is missing, you could simply inform the user to install it. For example, you could print an error message on startup that says "Default player is set to 'vlc', but no python support for 'vlc' was found. Please install python-vlc with pip install python-vlc.)". I suppose this is something of nuisance, but it's a one time thing. Having to fight my package manager to keep VLC off my system every upgrade seems like more work (and could 'scare away' new users).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants