ocrmypdf / OCRmyPDF

OCRmyPDF adds an OCR text layer to scanned PDF files, allowing them to be searched
http://ocrmypdf.readthedocs.io/
Mozilla Public License 2.0
14.08k stars 1.02k forks source link

[Bug]: --version gives 0.0.0 on Ubuntu snap #1176

Open pseudomonas opened 1 year ago

pseudomonas commented 1 year ago

What were you trying to do?

This is odd.

$ snap install ocrmypdf
ocrmypdf v15.1.0+git8.2b0e1498 from James Barlow (shael7aerien) installed
$ ocrmypdf --version
0.0.0
$ which ocrmypdf 
/snap/bin/ocrmypdf
$ ocrmypdf --version
[…copious help text as normal…]

Where are you installing from?

Ubuntu snap

What operating system are you working on?

Linux

Relevant log output

No response

jbarlow83 commented 1 year ago

ocrmypdf uses setuptools-scm, which derives the version from git tags. The version is then copied into virtual environment and retrieved using importlib.metadata.version('ocrmypdf'). I assume this means snapcraft is hacking virtual environments somehow....

pseudomonas commented 1 year ago

Also snap had a problem finding ghostscript's config and stuff (I can't give you a decent error message because I just swore at snap's habitual inability to play nicely with non-snap software, removed it, installed ocrmypdf via pip and never looked back)

jbarlow83 commented 1 year ago

You probably mean #1167. Yeah, it's not that cooperative.

I'm firmly on team flatpak personally and added the snap because others contributed it by PR... I might just discontinue it or replace with flatpak if it continues to be a hassle.

pseudomonas commented 1 year ago

Actually what would be awesome would be a PPA with an up-to-date .deb; the apt for LTS Ubuntu is ancient.

pseudomonas commented 1 year ago

Flatpak has "You configured your second hard drive to be mounted on /storage but I'm not going to touch that because it's not /home/something" problems and I know there's a dance you can do to fix it but it's a PITA.