soundconverter icon indicating copy to clipboard operation
soundconverter copied to clipboard

Handling DistributionNotFound exceptions

Open sezanzeb opened this issue 3 years ago • 4 comments

@jmaibaum does this work for you? Is the os.environ.get('container') == 'flatpak' test reliable?

sezanzeb avatar Jan 06 '22 20:01 sezanzeb

@sezanzeb Thanks for looking into this! A flatpak built from this PR's ref launches normally again, but it shows unknown-version instead of a proper version number. Both on the command line:

$ flatpak run --user org.soundconverter.SoundConverter//master
ERROR: Disabling mp3-id-tags output. Do you have "gst-plugins-good" installed?
ERROR: Disabling mp3-vbr-tags output. Do you have "gst-plugins-ugly" installed?
soundconverter unknown-version

and in the GUI:

Bildschirmfoto von 2022-01-07 21-37-57

Is it possible to specify the version at build time?

jmaibaum avatar Jan 07 '22 20:01 jmaibaum

"unknown-version" is the fallback for this case

Is it possible to specify the version at build time?

Yes, input-remapper does something similar with the commit hash: https://github.com/sezanzeb/input-remapper/blob/main/setup.py#L34, it writes it into a python file which is then imported during runtime. Instead of asking git tag or something we could also use a constant in setup.py with the version, use it in the DistUtilsExtra.auto.setup configuration and use it to generate a file that can be imported during runtime.

Or we hardcode the version number. It is hardcoded in setup.py already anyway. We just shouldn't forget to change it everywhere.

sezanzeb avatar Jan 07 '22 21:01 sezanzeb

I have no preference if you hardcode the version number or if I have to set it during packaging, but I'd prefer to have something else than "unknown version" showing up.

jmaibaum avatar Jan 09 '22 16:01 jmaibaum

I hope I'll find time to do this at some point, there are a lot of other things open in other projects right now

sezanzeb avatar Jan 17 '22 11:01 sezanzeb