Skip to content

Importing uplink from master fails without pydantic #328

@DonutByte

Description

@DonutByte

Describe the bug
If I import uplink from master branch without first installing the pydantic package, Python throws an error:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "c:\temp\venv\lib\site-packages\uplink\__init__.py", line 2, in <module>
    from uplink import returns, types
  File "c:\temp\venv\lib\site-packages\uplink\returns.py", line 6, in <module>
    from uplink import decorators
  File "c:\temp\venv\lib\site-packages\uplink\decorators.py", line 11, in <module>
    from uplink import arguments, helpers, hooks, interfaces, utils
  File "c:\temp\venv\lib\site-packages\uplink\arguments.py", line 14, in <module>
    from uplink.converters import keys
  File "c:\temp\venv\lib\site-packages\uplink\converters\__init__.py", line 18, in <module>
    from uplink.converters.pydantic_ import PydanticConverter
  File "c:\temp\venv\lib\site-packages\uplink\converters\pydantic_.py", line 1, in <module>
    import pydantic
ModuleNotFoundError: No module named 'pydantic'

To Reproduce
Steps to reproduce the behavior:

  1. install uplink from master (pip install git+https://github.com/prkumar/uplink.git@master)
  2. python -c "import uplink"

Expected behavior
uplink shouldn't require pydantic to be installed

Additional context
Looks like removing this line, fixes the issue:

I will link a PR that does this change 😄

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions