Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move streaming dependencies to their own "extra" #46

Merged
merged 2 commits into from
Apr 2, 2021

Conversation

axlan
Copy link
Contributor

@axlan axlan commented Mar 30, 2021

This is a PR as a follow up to: #45

This will by default not include the numpy, Pillow, and opencv dependencies with the library install. Those will be installed with:
pip install reolinkapi[streaming]

My test was to run the library locally with a virtualenv:

Test without extra

Install:

pip install -e .

Run:

Python 3.8.5 (default, Jan 27 2021, 15:41:15) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import reolinkapi
>>> cam = reolinkapi.Camera(HOST, USER, PASS)
Login success
>>> cam.open_video_stream()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/axlan/src/reolinkapipy/reolinkapi/mixins/stream.py", line 60, in open_video_stream
    raise ImportError('''open_video_stream requires streaming extra dependencies\nFor instance "pip install reolinkapi[streaming]"''')
ImportError: open_video_stream requires streaming extra dependencies
For instance "pip install reolinkapi[streaming]"

Test with extra

Install:

pip install -e '.[streaming]'

Run:

Python 3.8.5 (default, Jan 27 2021, 15:41:15) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import reolinkapi
>>> cam = reolinkapi.Camera(HOST, USER, PASS)
Login success
>>> cam.open_video_stream()
opening stream

@axlan axlan force-pushed the streaming-dependancy-extra branch from e1f4a93 to 98acbde Compare March 31, 2021 00:15
@Benehiko
Copy link
Member

Benehiko commented Apr 2, 2021

Hey @axlan this looks great! :)

@Benehiko Benehiko self-requested a review April 2, 2021 05:48
Copy link
Member

@Benehiko Benehiko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can also add some documentation on it if you'd like inside this repository :)
https://github.com/ReolinkCameraAPI/reolinkcameraapi.github.io

@Benehiko Benehiko linked an issue Apr 2, 2021 that may be closed by this pull request
@Benehiko Benehiko merged commit 806bbc3 into ReolinkCameraAPI:master Apr 2, 2021
@Benehiko
Copy link
Member

Benehiko commented Apr 2, 2021

I have also made a new release on pypi 🎉
Thank you for the contribution, really appreciate it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make image processing dependencies optional
2 participants