Giter Club home page Giter Club logo

coverlovin2's Introduction

Hello

I am James Thomas Moon. 👋 I am a software engineer. 🤓 Most of my experience is within testing and tools. 👷



My Open-Source Work Samples

The following lists are pubicly available examples of my work:

github Projects


Contribution Stats


Continuous Integration and Code Coverage

I've used several Continuous Integration (CI) services for the sake of learning about them. Here are example runs of each.

The archived links are provided because most CI Service providers expire detailed records.

Azure Pipelines

CircleCI

codecov.io

Github Actions

Travis CI

StackExchange Questions and Answers

Some of my favorite StackExchange posts:

Bug Reports and Feature Requests

Some public bug reports and feature requests I have made:






Pull Requests

My other github commits:

github Forum Posts

My favorite github forum posts:

Other Links

Contributing to Open Source

Among many other software projects and organizations that I have voluntarily donated!

Recommended podcasts

Software-oriented podcasts that I listen to irregularly.


profile for @JamesThomasMoon on Stack Exchange, a network of free, community-driven Q&A sites

coverlovin2's People

Contributors

dependabot[bot] avatar jtmoon79 avatar salexan2001 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

coverlovin2's Issues

running coverlovin2 with pytests fails with UnicodeEncodeError

Running coverlovin2 --test-only -se . within the coverlovin2 project directory results in

INFO: [MainThread coverlovin2]: Album details found: \uff5b "my artist" ¦ "my album" \uff5d within file "coverlovin2\coverlovin2\test\test_resources\ARTIST ALBUM.flac"
Traceback (most recent call last):
  File "C:\Python\Python37\Lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Python\Python37\Lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\user1\.virtualenvs\coverlovin2-rAPKj25Z\Scripts\coverlovin2.exe\__main__.py", line 9, in <module>
  File "c:\users\user1\.virtualenvs\coverlovin2-rapkj25z\scripts\coverlovin2.py", line 1832, in main
    print(msg)
  File "c:\users\user1\.virtualenvs\coverlovin2-rapkj25z\lib\encodings\cp1252.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\uff5b' in position 28: character maps to <undefined>

Using Windows 10 within MinGW Bash, $BASH_VERSION 4.4.23(1)-release, Python 3.7.1.

Running locale testing (taken from this SO A)

import os, sys, locale

print('environment:')
print('-E (ignore PYTHON* environment variables) ? %s' %
      (True if sys.flags.ignore_environment else False))
for env in ('LC_ALL', 'LANG', 'LC_CTYPE',
            'LANGUAGE', 'PYTHONIOENCODING',
            'PYTHONLEGACYWINDOWSSTDIO'):
    if env in os.environ:
        print('"%s"="%s"' % (env, os.environ[env]))
    else:
        print('"%s" not set' % env)

print()
print('sys module:')
print('getdefaultencoding "%s"' % sys.getdefaultencoding())
print('sys.stdin.encoding "%s"' % sys.stdin.encoding)
print('sys.stdout.encoding "%s"' % sys.stdout.encoding)
print('sys.stderr.encoding "%s"' % sys.stderr.encoding)

print()
print('locale:')
try:
    getattr(locale,'nl_langinfo')
    print('locale.nl_langinfo(locale.CODESET) "%s"' \
          % locale.nl_langinfo(locale.CODESET))
except AttributeError:
    print('locale.nl_langinfo not available')
print('locale.getdefaultlocale()[1] "%s"' \
      % locale.getdefaultlocale()[1])
print('locale.getpreferredencoding() "%s"' \
      % locale.getpreferredencoding())

results in

environment:
-E (ignore PYTHON* environment variables) ? False
"LC_ALL" not set
"LANG"="en_US.UTF-8"
"LC_CTYPE" not set
"LANGUAGE" not set
"PYTHONIOENCODING" not set
"PYTHONLEGACYWINDOWSSTDIO" not set

sys module:
getdefaultencoding "utf-8"
sys.stdin.encoding "cp1252"
sys.stdout.encoding "cp1252"
sys.stderr.encoding "cp1252"

locale:
locale.nl_langinfo not available
locale.getdefaultlocale()[1] "cp1252"
locale.getpreferredencoding() "cp1252"

improve printed table of results

It currently is pretty ugly.

It should truncate strings to fit into current console window.
The result column is too verbose.
No need to prepend (--test).

summary message would improve with final tally of:

  • images found
  • images not found due to cannot find
  • images not found or written due to errors
  • total albums paths processed

Travis 3.9 build fails; ModuleNotFoundError: No module named 'exceptiongroup'

Travis build for Python 3.9.15 fails to run pytest due to ModuleNotFoundError: No module named 'exceptiongroup'.

$ ./tools/pytest-run.sh --cov=./coverlovin2/ --cov-config=./.coveragerc --cov-report=xml --log-cli-level=DEBUG --verbosity=1
+exec python -m pytest -vv --full-trace --showlocals --cov-config=./.coveragerc --cov-report=xml --cov=./coverlovin2/ --cov-config=./.coveragerc --cov-report=xml --log-cli-level=DEBUG --verbosity=1 ./coverlovin2/
Traceback (most recent call last):
  File "/opt/python/3.9.15/lib/python3.9/runpy.py", line 188, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/opt/python/3.9.15/lib/python3.9/runpy.py", line 147, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "/opt/python/3.9.15/lib/python3.9/runpy.py", line 111, in _get_module_details
    __import__(pkg_name)
  File "/home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages/pytest/__init__.py", line 5, in <module>
    from _pytest._code import ExceptionInfo
  File "/home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages/_pytest/_code/__init__.py", line 2, in <module>
    from .code import Code
  File "/home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages/_pytest/_code/code.py", line 60, in <module>
    from exceptiongroup import BaseExceptionGroup
ModuleNotFoundError: No module named 'exceptiongroup'
The command "./tools/pytest-run.sh --cov=./coverlovin2/ --cov-config=./.coveragerc --cov-report=xml --log-cli-level=DEBUG --verbosity=1" exited with 1.

This only affects Python 3.9. Python versions 3.8, 3.10, 3.11 succeed in the same Travis build run and Travis configuration.

The prior dump of pip list shows (missing exceptiongroup)

$ pip list -vvv
Package            Version    Location                                                         Installer
------------------ ---------- ---------------------------------------------------------------- ---------
attrs              22.1.0     /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
autocommand        2.2.2      /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
bleach             5.0.1      /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
certifi            2022.12.7  /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
cffi               1.15.1     /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
charset-normalizer 2.1.1      /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
codecov            2.1.12     /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
commonmark         0.9.1      /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
coverage           6.5.0      /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
coveralls          3.3.1      /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
cryptography       38.0.4     /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
dataclasses        0.6        /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
distlib            0.3.6      /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
docopt             0.6.2      /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
docutils           0.19       /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
filelock           3.8.2      /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
idna               3.4        /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
importlib-metadata 5.1.0      /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
iniconfig          1.1.1      /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
jaraco.classes     3.2.3      /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
jeepney            0.8.0      /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
keyring            23.11.0    /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
mock               4.0.3      /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
more-itertools     9.0.0      /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
musicbrainzngs     0.7.1      /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
mutagen            1.46.0     /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
mypy               0.991      /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
mypy-extensions    0.4.3      /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
nose               1.3.7      /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
numpy              1.23.4     /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
packaging          22.0       /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
path               16.6.0     /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
pathspec           0.10.3     /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
Pillow             9.3.0      /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
pip                22.3.1     /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
pip-run            9.0.0      /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
pipenv             2022.11.30 /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
pkginfo            1.9.2      /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
platformdirs       2.6.0      /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
pluggy             1.0.0      /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
py                 1.11.0     /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
pycparser          2.21       /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
Pygments           2.13.0     /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
pyparsing          3.0.9      /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
pytest             7.2.0      /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
pytest-cov         4.0.0      /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
pytest-dependency  0.5.1      /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
PyYAML             6.0        /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
readme-renderer    37.3       /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
requests           2.28.1     /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
requests-toolbelt  0.10.1     /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
rfc3986            2.0.0      /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
rich               12.6.0     /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
SecretStorage      3.3.3      /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
setuptools         65.6.3     /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
six                1.16.0     /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
tabulate           0.9.0      /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
tomli              2.0.1      /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
twine              4.0.2      /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
typing_extensions  4.4.0      /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
urllib3            1.26.13    /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
virtualenv         20.17.1    /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
virtualenv-clone   0.5.7      /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
webencodings       0.5.1      /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
wheel              0.38.4     /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
yamllint           1.28.0     /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip
zipp               3.11.0     /home/travis/virtualenv/python3.9.15/lib/python3.9/site-packages pip

Whereas, pip list on Travis Python 3.8.13 build has exceptiongroup

Package            Version    Location                                                         Installer
------------------ ---------- ---------------------------------------------------------------- ---------
attrs              22.1.0     /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
autocommand        2.2.2      /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
bleach             5.0.1      /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
certifi            2022.12.7  /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
cffi               1.15.1     /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
charset-normalizer 2.1.1      /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
codecov            2.1.12     /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
commonmark         0.9.1      /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
coverage           6.5.0      /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
coveralls          3.3.1      /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
cryptography       38.0.4     /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
dataclasses        0.6        /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
distlib            0.3.6      /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
docopt             0.6.2      /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
docutils           0.19       /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
exceptiongroup     1.0.4      /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
filelock           3.8.2      /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
idna               3.4        /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
importlib-metadata 5.1.0      /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
iniconfig          1.1.1      /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
jaraco.classes     3.2.3      /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
jeepney            0.8.0      /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
keyring            23.11.0    /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
mock               4.0.3      /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
more-itertools     9.0.0      /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
musicbrainzngs     0.7.1      /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
mutagen            1.46.0     /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
mypy               0.991      /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
mypy-extensions    0.4.3      /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
nose               1.3.7      /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
numpy              1.23.1     /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
packaging          22.0       /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
path               16.6.0     /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
pathspec           0.10.3     /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
Pillow             9.3.0      /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
pip                22.3.1     /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
pip-run            9.0.0      /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
pipenv             2022.11.30 /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
pkginfo            1.9.2      /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
platformdirs       2.6.0      /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
pluggy             1.0.0      /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
py                 1.11.0     /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
pycparser          2.21       /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
Pygments           2.13.0     /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
pyparsing          3.0.9      /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
pytest             7.2.0      /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
pytest-cov         4.0.0      /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
pytest-dependency  0.5.1      /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
PyYAML             6.0        /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
readme-renderer    37.3       /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
requests           2.28.1     /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
requests-toolbelt  0.10.1     /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
rfc3986            2.0.0      /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
rich               12.6.0     /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
SecretStorage      3.3.3      /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
setuptools         65.6.3     /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
six                1.16.0     /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
tabulate           0.9.0      /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
tomli              2.0.1      /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
twine              4.0.2      /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
typing_extensions  4.4.0      /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
urllib3            1.26.13    /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
virtualenv         20.17.1    /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
virtualenv-clone   0.5.7      /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
webencodings       0.5.1      /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
wheel              0.38.4     /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
yamllint           1.28.0     /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip
zipp               3.11.0     /home/travis/virtualenv/python3.8.13/lib/python3.8/site-packages pip

Running git grep exceptiongroup does not have matches (so package exceptiongroup isn't specified within the project).

Looking at pytest project setup.cfg there is no obvious reason exceptiongroup fails to install.

Script fails with KeyError: 'JPG'

coverlovin2 -s- ~/Music
[...]
ERROR: [Thread-5 coverlovin2]: 'JPG'
Traceback (most recent call last):
  File "/usr/bin/coverlovin2.py", line 1731, in search_create_image
    res = is_.go()
  File "/usr/bin/coverlovin2.py", line 1036, in go
    return self.write_album_image()
  File "/usr/bin/coverlovin2.py", line 1113, in write_album_image
    self._image.save(self.copy_dst, self.image_type.value.upper())
  File "/usr/lib/python3.8/site-packages/PIL/Image.py", line 2140, in save
    save_handler = SAVE[format.upper()]
KeyError: 'JPG'
ERROR: [Thread-3 coverlovin2]: 'JPG'
Traceback (most recent call last):
  File "/usr/bin/coverlovin2.py", line 1731, in search_create_image
    res = is_.go()
  File "/usr/bin/coverlovin2.py", line 1036, in go
    return self.write_album_image()
  File "/usr/bin/coverlovin2.py", line 1113, in write_album_image
    self._image.save(self.copy_dst, self.image_type.value.upper())
  File "/usr/lib/python3.8/site-packages/PIL/Image.py", line 2140, in save
    save_handler = SAVE[format.upper()]
KeyError: 'JPG'

The script doesn't stop. It hangs "forever". I have to press CTRL-C to abort the script. It also doesn't finish when using --test

This error is added when I press CTRL-C:

^CTraceback (most recent call last):
  File "/usr/bin/coverlovin2", line 8, in <module>
    sys.exit(main())
  File "/usr/bin/coverlovin2.py", line 2087, in main
    task_queue.join()
  File "/usr/lib/python3.8/queue.py", line 89, in join
    self.all_tasks_done.wait()
  File "/usr/lib/python3.8/threading.py", line 302, in wait
    waiter.acquire()
KeyboardInterrupt

Circle CI `test_pytest` fails; ModuleNotFoundError: pluggy

During Circle CI job test_pytest, during the run step, is script code:

      - run:
          name: test coverlovin2 pytests
          command: |
            set -eux
            pwd
            SHELL_ENV=.shell-env
            source "${SHELL_ENV}"
            "${PIPENV}" run pip list -v
            "${PIPENV}" run pytest -v ./coverlovin2/test

The call to "${PIPENV}" run pytest -v ./coverlovin2/test fails with

+ /home/circleci/.pipenv-venv/project-zxI9dQ-Q/bin/pipenv run pytest -v ./coverlovin2/test
Traceback (most recent call last):
  File "/home/circleci/.pipenv-venv/project-zxI9dQ-Q/bin/pytest", line 5, in <module>
    from pytest import console_main
  File "/home/circleci/.pipenv-venv/project-zxI9dQ-Q/lib/python3.7/site-packages/pytest/__init__.py", line 5, in <module>
    from _pytest._code import ExceptionInfo
  File "/home/circleci/.pipenv-venv/project-zxI9dQ-Q/lib/python3.7/site-packages/_pytest/_code/__init__.py", line 2, in <module>
    from .code import Code
  File "/home/circleci/.pipenv-venv/project-zxI9dQ-Q/lib/python3.7/site-packages/_pytest/_code/code.py", line 35, in <module>
    import pluggy
ModuleNotFoundError: No module named 'pluggy'

Exited with code exit status 1

Oddly, pluggy was added to Pipfile should be installed (as of 177417d).

The full output looks like:

+ pwd
/home/circleci/project
+ SHELL_ENV=.shell-env
+ source .shell-env
++ export PIPENV_CACHE_DIR=/home/circleci/.pipenv-cache
++ PIPENV_CACHE_DIR=/home/circleci/.pipenv-cache
++ export PIPENV_VIRTUALENV=/home/circleci/.pipenv-venv
++ PIPENV_VIRTUALENV=/home/circleci/.pipenv-venv
++ export WORKON_HOME=/home/circleci/.pipenv-venv
++ WORKON_HOME=/home/circleci/.pipenv-venv
++ export PIPENV=/home/circleci/.pipenv-venv/project-zxI9dQ-Q/bin/pipenv
++ PIPENV=/home/circleci/.pipenv-venv/project-zxI9dQ-Q/bin/pipenv
+ /home/circleci/.pipenv-venv/project-zxI9dQ-Q/bin/pipenv run pip list -v
Package            Version   Location                                                                 Installer
------------------ --------- ------------------------------------------------------------------------ ---------
attrs              23.1.0    /home/circleci/.pipenv-venv/project-zxI9dQ-Q/lib/python3.7/site-packages pip
autocommand        2.2.2     /home/circleci/.pipenv-venv/project-zxI9dQ-Q/lib/python3.7/site-packages pip
certifi            2023.7.22 /home/circleci/.pipenv-venv/project-zxI9dQ-Q/lib/python3.7/site-packages pip
charset-normalizer 3.3.2     /home/circleci/.pipenv-venv/project-zxI9dQ-Q/lib/python3.7/site-packages pip
codecov            2.1.13    /home/circleci/.pipenv-venv/project-zxI9dQ-Q/lib/python3.7/site-packages pip
coverage           6.5.0     /home/circleci/.pipenv-venv/project-zxI9dQ-Q/lib/python3.7/site-packages pip
coveralls          3.3.1     /home/circleci/.pipenv-venv/project-zxI9dQ-Q/lib/python3.7/site-packages pip
cryptography       41.0.5    /home/circleci/.pipenv-venv/project-zxI9dQ-Q/lib/python3.7/site-packages pip
distlib            0.3.7     /home/circleci/.pipenv-venv/project-zxI9dQ-Q/lib/python3.7/site-packages pip
docopt             0.6.2     /home/circleci/.pipenv-venv/project-zxI9dQ-Q/lib/python3.7/site-packages pip
docutils           0.20.1    /home/circleci/.pipenv-venv/project-zxI9dQ-Q/lib/python3.7/site-packages pip
exceptiongroup     1.1.3     /home/circleci/.pipenv-venv/project-zxI9dQ-Q/lib/python3.7/site-packages pip
filelock           3.12.2    /home/circleci/.pipenv-venv/project-zxI9dQ-Q/lib/python3.7/site-packages pip
idna               3.4       /home/circleci/.pipenv-venv/project-zxI9dQ-Q/lib/python3.7/site-packages pip
importlib-metadata 6.7.0     /home/circleci/.pipenv-venv/project-zxI9dQ-Q/lib/python3.7/site-packages pip
iniconfig          2.0.0     /home/circleci/.pipenv-venv/project-zxI9dQ-Q/lib/python3.7/site-packages pip
jaraco.context     4.3.0     /home/circleci/.pipenv-venv/project-zxI9dQ-Q/lib/python3.7/site-packages pip
jaraco.env         1.0.0     /home/circleci/.pipenv-venv/project-zxI9dQ-Q/lib/python3.7/site-packages pip
jaraco.text        3.11.1    /home/circleci/.pipenv-venv/project-zxI9dQ-Q/lib/python3.7/site-packages pip
jeepney            0.8.0     /home/circleci/.pipenv-venv/project-zxI9dQ-Q/lib/python3.7/site-packages pip
mdurl              0.1.2     /home/circleci/.pipenv-venv/project-zxI9dQ-Q/lib/python3.7/site-packages pip
musicbrainzngs     0.7.1     /home/circleci/.pipenv-venv/project-zxI9dQ-Q/lib/python3.7/site-packages pip
mutagen            1.47.0    /home/circleci/.pipenv-venv/project-zxI9dQ-Q/lib/python3.7/site-packages pip
mypy-extensions    1.0.0     /home/circleci/.pipenv-venv/project-zxI9dQ-Q/lib/python3.7/site-packages pip
nh3                0.2.14    /home/circleci/.pipenv-venv/project-zxI9dQ-Q/lib/python3.7/site-packages pip
packaging          23.2      /home/circleci/.pipenv-venv/project-zxI9dQ-Q/lib/python3.7/site-packages pip
pathspec           0.11.2    /home/circleci/.pipenv-venv/project-zxI9dQ-Q/lib/python3.7/site-packages pip
pip                23.3.1    /home/circleci/.pipenv-venv/project-zxI9dQ-Q/lib/python3.7/site-packages pip
pipenv             2023.10.3 /home/circleci/.pipenv-venv/project-zxI9dQ-Q/lib/python3.7/site-packages pip
pkginfo            1.9.6     /home/circleci/.pipenv-venv/project-zxI9dQ-Q/lib/python3.7/site-packages pip
platformdirs       3.11.0    /home/circleci/.pipenv-venv/project-zxI9dQ-Q/lib/python3.7/site-packages pip
pycparser          2.21      /home/circleci/.pipenv-venv/project-zxI9dQ-Q/lib/python3.7/site-packages pip
pydantic           2.4.2     /home/circleci/.pipenv-venv/project-zxI9dQ-Q/lib/python3.7/site-packages pip
pydantic_core      2.10.1    /home/circleci/.pipenv-venv/project-zxI9dQ-Q/lib/python3.7/site-packages pip
Pygments           2.16.1    /home/circleci/.pipenv-venv/project-zxI9dQ-Q/lib/python3.7/site-packages pip
pytest             7.4.3     /home/circleci/.pipenv-venv/project-zxI9dQ-Q/lib/python3.7/site-packages pip
pytest-cov         4.1.0     /home/circleci/.pipenv-venv/project-zxI9dQ-Q/lib/python3.7/site-packages pip
pytest-dependency  0.5.1     /home/circleci/.pipenv-venv/project-zxI9dQ-Q/lib/python3.7/site-packages pip
PyYAML             6.0.1     /home/circleci/.pipenv-venv/project-zxI9dQ-Q/lib/python3.7/site-packages pip
requests           2.31.0    /home/circleci/.pipenv-venv/project-zxI9dQ-Q/lib/python3.7/site-packages pip
requests-toolbelt  1.0.0     /home/circleci/.pipenv-venv/project-zxI9dQ-Q/lib/python3.7/site-packages pip
rfc3986            2.0.0     /home/circleci/.pipenv-venv/project-zxI9dQ-Q/lib/python3.7/site-packages pip
rich               13.6.0    /home/circleci/.pipenv-venv/project-zxI9dQ-Q/lib/python3.7/site-packages pip
SecretStorage      3.3.3     /home/circleci/.pipenv-venv/project-zxI9dQ-Q/lib/python3.7/site-packages pip
setuptools         68.0.0    /home/circleci/.pipenv-venv/project-zxI9dQ-Q/lib/python3.7/site-packages pip
tabulate           0.9.0     /home/circleci/.pipenv-venv/project-zxI9dQ-Q/lib/python3.7/site-packages pip
tomli              2.0.1     /home/circleci/.pipenv-venv/project-zxI9dQ-Q/lib/python3.7/site-packages pip
twine              4.0.2     /home/circleci/.pipenv-venv/project-zxI9dQ-Q/lib/python3.7/site-packages pip
typing_extensions  4.7.1     /home/circleci/.pipenv-venv/project-zxI9dQ-Q/lib/python3.7/site-packages pip
urllib3            2.0.7     /home/circleci/.pipenv-venv/project-zxI9dQ-Q/lib/python3.7/site-packages pip
virtualenv         20.24.6   /home/circleci/.pipenv-venv/project-zxI9dQ-Q/lib/python3.7/site-packages pip
wheel              0.41.3    /home/circleci/.pipenv-venv/project-zxI9dQ-Q/lib/python3.7/site-packages pip
yamllint           1.32.0    /home/circleci/.pipenv-venv/project-zxI9dQ-Q/lib/python3.7/site-packages pip
zipp               3.15.0    /home/circleci/.pipenv-venv/project-zxI9dQ-Q/lib/python3.7/site-packages pip
+ /home/circleci/.pipenv-venv/project-zxI9dQ-Q/bin/pipenv run pytest -v ./coverlovin2/test
Traceback (most recent call last):
  File "/home/circleci/.pipenv-venv/project-zxI9dQ-Q/bin/pytest", line 5, in <module>
    from pytest import console_main
  File "/home/circleci/.pipenv-venv/project-zxI9dQ-Q/lib/python3.7/site-packages/pytest/__init__.py", line 5, in <module>
    from _pytest._code import ExceptionInfo
  File "/home/circleci/.pipenv-venv/project-zxI9dQ-Q/lib/python3.7/site-packages/_pytest/_code/__init__.py", line 2, in <module>
    from .code import Code
  File "/home/circleci/.pipenv-venv/project-zxI9dQ-Q/lib/python3.7/site-packages/_pytest/_code/code.py", line 35, in <module>
    import pluggy
ModuleNotFoundError: No module named 'pluggy'

Exited with code exit status 1

ArtAlb may have empty Artist Album

Parsing a path with Album directory

Robert Fripp • 2005 • Love Cannot Bear

with one untagged .flac file, resulted in an ArtAlb string value [ "" • "" ] .

An empty ArtAlb shoudl be dropped.
Ideally, the process_dir would improve it's guess of Artist and Album based on the obvious directory name pattern.

Filter based on availibility of cover art in cases of ambiguity

I was looking for a tool to automatically retrieve cover art from musicbrainz and coverlovin2 seems to be a great tool!

I stumbled upon cases where many identical results ("same" release in different countries) were found, so similarity for all of the results was 1.0. Unfortunately only some of them had an image attached as cover-art.

Example (Haken - Affinity):
1.0 false 46c59b2c-4ed7-496f-a356-16b7f5342aab Affinity
1.0 true c6e788ec-8154-46fa-a828-e05213463ce4 Affinity
1.0 true 02a0b4ec-83fe-452e-8231-8eaac6321203 Affinity
1.0 true 3691b471-13da-47f8-bb45-06bc24d0a70a Affinity
1.0 true 6f5aa955-3a6e-4a76-b622-6337ea1b956b Affinity
1.0 true 35b0af48-27ab-4005-959c-3ae947fc8639 Affinity

(First column is similarity, second column is availibility of cover-art.)

I suggest adding a filter for availibility of cover-art before doing the album scoring.

I will try to create a corresponding pull request.

pytest fails on Travis CI Test_ImageSearcher_LikelyCover.test_write_album_image for "happy path" cases

From https://travis-ci.com/jtmoon79/coverlovin2/jobs/181976062

two tests fail

coverlovin2/test/test_coverlovin2.py::Test_ImageSearcher_LikelyCover::test_write_album_image[happy path - case 1 - overwrite False] FAILED [ 51%]
coverlovin2/test/test_coverlovin2.py::Test_ImageSearcher_LikelyCover::test_write_album_image[happy path - case 2 - overwrite True] FAILED [ 52%]

These do not fail on my machine! :-(

_ Test_ImageSearcher_LikelyCover.test_write_album_image[happy path - case 2 - overwrite True] _
self = <coverlovin2.test.test_coverlovin2.Test_ImageSearcher_LikelyCover object at 0x7f9d745ea0b8>
image_path_src = PosixPath('/home/travis/build/jtmoon79/coverlovin2/coverlovin2/test/test_resources/test_ImageSearcher_LikelyCover3/album1.jpg')
image_path_dst = PosixPath('/home/travis/build/jtmoon79/coverlovin2/coverlovin2/test/test_resources/test_ImageSearcher_LikelyCover3/album-not-exists-file.jpg')
image_type = <ImageType.JPG: 'jpg'>, overwrite = True
result = Result(artalb=('', ''), imagesearcher_type=<class 'coverlovin2.coverlovin2.ImageSearcher_LikelyCover'>, image_path=Pos...overlovin2/test/test_resources/test_ImageSearcher_LikelyCover3/album-not-exists-file.jpg"', error=False, error_mesg='')
    @pytest.mark.parametrize(
        'image_path_src, image_path_dst, image_type, overwrite, ' +
        'result',
        (
            pytest.param
            (
                B3_image_path1, B3_image_path2, jpg, False,
                Result.SkipDueToNoOverwrite(ArtAlb_empty, ImageSearcher_LikelyCover, B3_image_path2, False, True),
                id='destination image already exists - overwrite False, returns False'
            ),
            pytest.param
            (
                B3_image_path1, B3_image_path2, jpg, True,
                Result.Copied(ArtAlb_empty, ImageSearcher_LikelyCover, B3_image_path1_sz, B3_image_path1, B3_image_path2, True, True),
                id='destination image already exists - overwrite True, returns True'
            ),
            pytest.param
            (
                B3_image_path1, B3_image_path_ne, jpg, False,
                Result.Copied(ArtAlb_empty, ImageSearcher_LikelyCover, 0, B3_image_path1, B3_image_path_ne, False, True),
                id='happy path - case 1 - overwrite False'
            ),
            pytest.param
            (
                B3_image_path1, B3_image_path_ne, jpg, True,
                Result.Copied(ArtAlb_empty, ImageSearcher_LikelyCover, 0, B3_image_path1, B3_image_path_ne, True, True),
                id='happy path - case 2 - overwrite True'
            )
        )
    )
    @pytest.mark.dependency(name='test_res_B3')
    def test_write_album_image(self, image_path_src, image_path_dst, image_type, overwrite, result):
        is_ = ImageSearcher_LikelyCover(ArtAlb_empty, image_path_dst, '', False)
        assert is_.search_album_image(image_type)
>       assert result == is_.write_album_image(Path(), overwrite, True)
E       assert Result(artalb...error_mesg='') == Result(artalb=...error_mesg='')
E         At index 8 diff: '(--test) ImageSearcher_LikelyCover copied 0 bytes from "/home/travis/build/jtmoon79/coverlovin2/coverlovin2/test/test_resources/test_ImageSearcher_LikelyCover3/album1.jpg" to "/home/travis/build/jtmoon79/coverlovin2/coverlovin2/test/test_resources/test_ImageSearcher_LikelyCover3/album-not-exists-file.jpg"' != '(--test) ImageSearcher_LikelyCover copied 0 bytes from "/home/travis/build/jtmoon79/coverlovin2/coverlovin2/test/test_resources/test_ImageSearcher_LikelyCover3/album2.jpg" to "/home/travis/build/jtmoon79/coverlovin2/coverlovin2/test/test_resources/test_ImageSearcher_LikelyCover3/album-not-exists-file.jpg"'
E         Full diff:
E         - Result(artalb=('', ''), imagesearcher_type=<class 'coverlovin2.coverlovin2.ImageSearcher_LikelyCover'>, image_path=PosixPath('/home/travis/build/jtmoon79/coverlovin2/coverlovin2/test/test_resources/test_ImageSearcher_LikelyCover3/album-not-exists-file.jpg'), image_type=None, result_written=True, overwrite=True, test=True, result_nosuitable=False, message='(--test) ImageSearcher_LikelyCover copied 0 bytes from "/home/travis/build/jtmoon79/coverlovin2/coverlovin2/test/test_resources/test_ImageSearcher_LikelyCover3/album1.jpg" to "/home/travis/build/jtmoon79/coverlovin2/coverlovin2/test/test_resources/test_ImageSearcher_LikelyCover3/album-not-exists-file.jpg"', error=False, error_mesg='')
E         ?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ^
E         + Result(artalb=('', ''), imagesearcher_type=<class 'coverlovin2.coverlovin2.ImageSearcher_LikelyCover'>, image_path=PosixPath('/home/travis/build/jtmoon79/coverlovin2/coverlovin2/test/test_resources/test_ImageSearcher_LikelyCover3/album-not-exists-file.jpg'), image_type=None, result_written=True, overwrite=True, test=True, result_nosuitable=False, message='(--test) ImageSearcher_LikelyCover copied 0 bytes from "/home/travis/build/jtmoon79/coverlovin2/coverlovin2/test/test_resources/test_ImageSearcher_LikelyCover3/album2.jpg" to "/home/travis/build/jtmoon79/coverlovin2/coverlovin2/test/test_resources/test_ImageSearcher_LikelyCover3/album-not-exists-file.jpg"', error=False, error_mesg='')
E         ?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ^
coverlovin2/test/test_coverlovin2.py:733: AssertionError

do not bury imports

Some imports are buried. This was to avoid requiring the user to install big dependencies (i.e. Pillow, mutagen) when they are not used.

But this is not Pythonic. Presume the user is running coverlovin2 with necessary dependencies.

add --exclude option to exclude matched paths

Currently, an entire directory path is exhaustively searched. Sometimes this is too much and takes too long.

Allow the user to pass --exclude that matches directory path names with a simple globbing pattern.

add Windows build

add a Travis CI job for Windows build os: win. Build the py2exe build.

add discogs searching

Add searching of www.discogs.com. It has a great Python client and it's very thorough.
This is currently partially implemented --search-discogs.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.