4doom4 / python-voipms

Python client for v1 of voip.ms REST API
MIT License
24 stars 12 forks source link

Installation issue: Validators library #21

Open smatterchoo opened 6 months ago

smatterchoo commented 6 months ago

I just pip installed voipms and tried to import it in python. Got error about missing library validators. So I pip installed validators. Tried again to import voipms in python, got error about missing ValidationFailure (the validators library defines ValidationError, not ValidationFailure).

ImportError: cannot import name 'ValidationFailure' from 'validators' (/home/alarm_user/alarm2024/venv/lib/python3.11/s\
ite-packages/validators/__init__.py)

There's another library validator-collection that does have a ValidationFailure, but that one doesn't satisfy the "import validators" line in the voipms code.

The pip installation of voipms doesn't require either of these libraries.

Can you advise?

smatterchoo commented 6 months ago

The bug is in voipms/entities/didssend.py See the import statements and the valid_url function

I think ValidationFailure should be changed to ValidationError

Also need to add validators (perhaps with specific version number) to requirements

thromer commented 5 months ago

Pull request here: https://github.com/4doom4/python-voipms/pull/22

automatyck commented 4 months ago

I've run into the same issue running python-voipms through PyScript on Home Assistant.

ImportError: cannot import name 'ValidationFailure' from 'validators' (/usr/local/lib/python3.12/site-packages/validators/__init__.py)

Thanks for putting together the pull request @thromer! Looking forward to having this resolved.