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

Some dependency issues #9

Closed
eriko-de opened this issue Jun 19, 2022 · 3 comments
Closed

Some dependency issues #9

eriko-de opened this issue Jun 19, 2022 · 3 comments
Assignees
Labels
compatibility Python version compatibility

Comments

@eriko-de
Copy link

Hey, first of all many thanks for this awesome libary :)

I used it to test and play around with some adderlib devices on a network running a script on a raspberry pi.

When I was using it, I found two minor issues related to dependencies and runtimes:

  1. The 'xmltodict' libary needs to be forced to be <0.13, I'm not an export in python programming, but it seems the version requirement is set in the requirements.txt, when setting up this project, but when installing adderlib via pip, it seems to use the latest version.
  2. When using default python on raspberry pi (version 3.7), you get an error message:
Traceback (most recent call last):
  File "/usr/local/bin/kvm_switcher.py", line 3, in <module>
    from adderlib import adder
  File "/usr/local/lib/python3.7/dist-packages/adderlib/adder.py", line 13, in <module>
    class AdderAPI:
  File "/usr/local/lib/python3.7/dist-packages/adderlib/adder.py", line 257, in AdderAPI
    group_name:typing.Optional[str]=None) -> AdderChannel:
TypeError: 'type' object is not subscriptable

I needed to compile the latest python version (3.10.5 at that time) to have it work.

This is my first python project so maybe there is an easier solution for the issues. Just wanted to share my experiences

@mjiggidy
Copy link
Owner

Appreciate all the great info! Can you please confirm Raspberry Pi defaults to Python 3.7.3 just so I can recreate the environment exactly?

@mjiggidy mjiggidy self-assigned this Jun 21, 2022
@mjiggidy mjiggidy added the compatibility Python version compatibility label Jun 21, 2022
@mjiggidy
Copy link
Owner

mjiggidy commented Jun 22, 2022

I have addressed the two issues:

  1. xmltodict recently released version 0.13.0 which breaks the type hinting in adderlib (they are no longer using OrderedDict). Set the required version to 0.12.0 for now; will include support for newer versions of xmltodict in a future release.

  2. Used older-style typing.List type hinting for compatibility with python3.7.x to address the "not subscriptable" error.

These changes are currently available in the py3.7-fixes branch here:
https://github.com/mjiggidy/adderlib/tree/py3.7-fixes

@eriko-de If you're comfortable cloning this branch and installing (python3 setup.py install) into the default Raspberry Pi python 3.7 environment, would you mind testing and verifying this fixes your issues before I roll it out to PyPi? Please be sure to remove any previous installations of adderlib or xmltodict first.

Thanks!

@mjiggidy mjiggidy mentioned this issue Jun 27, 2022
@mjiggidy
Copy link
Owner

mjiggidy commented Jun 27, 2022

Merged the fixes to the master branch and issued v1.0.3 to PyPi. Please let me know if this continues to be an issue.

Thanks!

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

No branches or pull requests

2 participants