dhmay / jamstats

Tools for making plots on roller derby scoreboard data and following live game data
https://jamstats.net
GNU General Public License v2.0
19 stars 2 forks source link

[FR] GUI-less package variant for easier install on headless servers (dropping wxWidgets etc) #143

Open aoanla opened 1 year ago

aoanla commented 1 year ago

Currently the pip package for jamstats is "batteries included", pulling in wxWidgets to let it run the GUI interface if you want it.

However: wxWidgets is finicky to install with the newest python (3.11) due to their usual slow updates to new python releases. In addition, wxWidgets has a heavy set of dependancies for its GUI (libgtk-3 and friends) which are not normally installed on headless servers - and aren't needed if you aren't going to use the GUI at all.

It would be easier to support headless installs if a spin of jamstats without the GUI were available for command line use only.

(I speak of this from the personal experience of having tried to install jamstats on an RPi4 headless with alpine, where the final straw was the need for all the gtk stuff ;) )

dhmay commented 1 year ago

That's a great idea.

Probably the most elegant way to do it would be to maintain two repos, "jamstats-base" (without the GUI dependencies) and "jamstats", which depends on jamstats-base. But that would be pretty destabilizing for anyone who's been playing around with the code.

I'm inclined, instead, to keep distributing jamstats with all the code including GUI, and hack up a "jamstats-nogui" package for your use case that duplicates all the code. I can update both packages whenever I put out a new release, but you wouldn't easily be able to get any between-release fixes/enhancements.

Sound OK?

aoanla commented 1 year ago

That sounds perfect - I agree that the "default" spin should be batteries-included. headless is a minority use case.

dhmay commented 1 year ago

Yeah, I'm curious about your use case. Are you adding jamstats to a post-game data pipeline?

aoanla commented 1 year ago

I'm trying to integrate it into a live service (alongside a wsproxy on the same host) to serve read-only stats for live games. But because this is a lightweight container, it really doesn't need the gui stuff, especially as this instance will always get its scoreboard feed from the wsproxy in the same host as it [and will potentially be reverse-proxied on the other side, so it's always serving to localhost:somelocalport as far as it is concerned].

dhmay commented 1 year ago

Oh, nice! That's super cool. Let me know if Jamstats can produce anything else that would be helpful for that service. Right now it's almost entirely about making plots, but it could also produce summary statistics or text summaries of game action (like the current skaters summary for announcers).

dhmay commented 1 year ago

Could you please give the jamstats-nogui package a shot?

https://pypi.org/project/jamstats-nogui/1.2.1/

It's a little clunky... both packages have the jamstats script, and that's the one with the GUI dependency. They also both have jamstats-nogui, which doesn't have the dependency.

aoanla commented 1 year ago

I get:

ollecting jamstats-nogui Downloading jamstats-nogui-1.2.1.tar.gz (39 kB) Preparing metadata (setup.py) ... done WARNING: Generating metadata for package jamstats-nogui produced metadata for project name jamstats. Fix your #egg=jamstats-nogui fragments. Discarding https://files.pythonhosted.org/packages/0b/4b/c63a437cc09a5854988624f6f3df3179ff9a10107c1149dd7907fd36dcca/jamstats-nogui-1.2.1.tar.gz (from https://pypi.org/simple/jamstats-nogui/): Requested jamstats from https://files.pythonhosted.org/packages/0b/4b/c63a437cc09a5854988624f6f3df3179ff9a10107c1149dd7907fd36dcca/jamstats-nogui-1.2.1.tar.gz has inconsistent name: expected 'jamstats-nogui', but metadata has 'jamstats' ERROR: Could not find a version that satisfies the requirement jamstats-nogui (from versions: 1.2.1) ERROR: No matching distribution found for jamstats-nogui

which looks like just a bit of metadata needs fixing.

dhmay commented 1 year ago

Sorry about that. Please try again. I think I've got it, now, in jamstats-gui version 1.2.1.2.

aoanla commented 1 year ago

Same error, sadly with 1.2.1.2

dhmay commented 1 year ago

Well, this is clearly not my area of expertise. I fixed some problems, but the "inconsistent name" issue remains.

You should be able to do this, however: pip install jamstats-nogui --use-deprecated=legacy-resolver

Will that work for you for now? I can keep at the mismatch problem... unless you happen to know how to solve it!

aoanla commented 1 year ago

That works for me (and I tested it and it does work with the workaround) thanks