regosen / get_cover_art

Batch cover art downloader and embedder for audio files

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add top-level script.

vext01 opened this issue · comments

(great project! Thank you)

It would be more user-friendly if when you install get_cover_art a script is installed in bin/ so that instead of:

python -m get_cover_art ...

Users run:

get_cover_art ...

Thanks

Hi, that sounds like an easy win, but I'm not familiar with how to achieve this. Can you point me to another github project that does this? I'll use that as reference. Thanks!

I think you'd usually do it in your setup.py script (or setup.cfg).

You need to define an entry point. Docs here.

Examples:

Thanks for the examples, that helps a lot! I just uploaded v1.4.10 to pypi with these changes, and I think it should work, but I'm not used to your use case.

Can you try pip install get_cover_art --upgrade and give it a shot? If it works, I'll git push my changes as well.

Hi,

Thanks for the fast response.

The script is being installed correctly, but something is wrong with your dependencies.

On a system that i've not installed get_cover_art on yet:

$ pip3.8 install get_cover_art
Defaulting to user installation because normal site-packages is not writeable
Collecting get_cover_art
  Downloading get_cover_art-1.4.10-py3-none-any.whl (20 kB)
Installing collected packages: get-cover-art
Successfully installed get-cover-art-1.4.10
$ ~/.local/bin/get_cover_art 
Traceback (most recent call last):
  File "/home/edd/.local/bin/get_cover_art", line 5, in <module>
    from get_cover_art import main
  File "/home/edd/.local/lib/python3.8/site-packages/get_cover_art/__init__.py", line 1, in <module>
    from .cover_finder import CoverFinder
  File "/home/edd/.local/lib/python3.8/site-packages/get_cover_art/cover_finder.py", line 5, in <module>
    from .meta.meta_mp3 import MetaMP3
  File "/home/edd/.local/lib/python3.8/site-packages/get_cover_art/meta/meta_mp3.py", line 2, in <module>
    from mutagen.mp3 import MP3
ModuleNotFoundError: No module named 'mutagen'

Did you list your dependencies in setup.py (or in a requirements.txt)?

See these docs.

Ah, thanks for trying this out. I just discovered I can use python setup.py develop to test locally. Can you try upgrading to 1.4.11 and try it again?

I saw it install mutagen this time. LGTM :)

Thanks!

By the way, where are you making these changes? I can't see the commits.

I was holding out from pushing until you verified the fix, pushed now.

(Until now I've excluded setup.py from the repo because it includes the version number and changing that would be a lot of noise... but I'm reading now of ways around that, so I'll introduce setup.py soon)

I wouldn't worry about the noise. It's standard practice to include version bump commits. Then the whole process is reproducible for third parties.

Fair point, added!