opencv and pillow are mandatory
Bug/Issue Description: opencv is marked as optional, but dvr-scan does not work without it. It happens on main c00ff6f0cd7f122ebba578a805bb7677eb6c2ab0.
Required Information:
$ dvr-scan --help
[...]
from dvr_scan.__main__ import main
File "/home/frafra/Code/DVR-Scan/dvr_scan/__init__.py", line 39, in <module>
import dvr_scan.opencv_loader as _ # noqa: F401
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/frafra/Code/DVR-Scan/dvr_scan/opencv_loader.py", line 34, in <module>
raise ModuleNotFoundError(
ModuleNotFoundError: OpenCV could not be found, try installing opencv-python:
pip install opencv-python
Expected Behavior: opencv should be optional, right? :)
Computing Environment:
- OS: Linux
- Python Version: 3.12
- OpenCV Version: N/A
Pillow is not listed as dependency for opencv-python-headless, but it is needed.
This also happens when installing the package via pip without the optional opencv.
Thanks for the report, I fixed this in 115e6b6ad68c6f4811392e6e1811c33e9d6a5c12 recently, which will be included in the next release (probably in a day or two). It shouldn't be needed for the headless version after v1.7 comes out.
opencv should be optional, right? :)
I agree, I should probably create a separate dvr-scan-headless package and make these dependencies non-optional. Thoughts?
Assuming we want to make the dependencies mandatory, that implies we'll need separate packages for the headless vs. non-headless distributions. I am open to fixing this, but could use some input on the best way to resolve the issue.
Do you know if it's possible to create two separate packages from a single pyproject.toml file?
The correct way is probably to move the bulk of the code into something like dvr-scan-core, and have a "meta" dvr-scan and dvr-scan-headless package, where the latter two just provide the entry points.
I should probably create a separate dvr-scan-headless package and make these dependencies non-optional. Thoughts?
It is trickier to get a Python interpreted with tkinter than installing opencv, so it makes sense to have a headless version.
Do you know if it's possible to create two separate packages from a single pyproject.toml file?
I do not think it is possible, but I would need to check more carefully.