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

duffy errors when installed with pip #864

Closed
carlosrodfern opened this issue Jul 4, 2023 · 2 comments · Fixed by #865
Closed

duffy errors when installed with pip #864

carlosrodfern opened this issue Jul 4, 2023 · 2 comments · Fixed by #865

Comments

@carlosrodfern
Copy link
Contributor

Steps to Reproduce:

python3 -m venv venv
. ./venv/bin/activate
python3 -m pip install duffy
duffy -help
/home/user/Dev/centos-stream/venv/lib64/python3.11/site-packages/pydantic/_internal/_config.py:257: UserWarning: Valid config keys have changed in V2:
* 'orm_mode' has been renamed to 'from_attributes'
  warnings.warn(message, UserWarning)
Traceback (most recent call last):
  File "/home/user/Dev/centos-stream/venv/bin/duffy", line 5, in <module>
    from duffy.cli import cli
  File "/home/user/Dev/centos-stream/venv/lib64/python3.11/site-packages/duffy/cli.py", line 34, in <module>
    from .configuration import config, read_configuration
  File "/home/user/Dev/centos-stream/venv/lib64/python3.11/site-packages/duffy/configuration/__init__.py", line 1, in <module>
    from .main import config, config_get, read_configuration  # noqa: F401
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/Dev/centos-stream/venv/lib64/python3.11/site-packages/duffy/configuration/main.py", line 10, in <module>
    from .validation import ConfigModel
  File "/home/user/Dev/centos-stream/venv/lib64/python3.11/site-packages/duffy/configuration/validation.py", line 7, in <module>
    from pydantic import (
  File "/home/user/Dev/centos-stream/venv/lib64/python3.11/site-packages/pydantic/__init__.py", line 206, in __getattr__
    return _getattr_migration(attr_name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/Dev/centos-stream/venv/lib64/python3.11/site-packages/pydantic/_migration.py", line 285, in wrapper
    raise PydanticImportError(f'`{import_path}` has been removed in V2.')
pydantic.errors.PydanticImportError: `pydantic:stricturl` has been removed in V2.

For further information visit https://errors.pydantic.dev/2.0/u/import-error

The issue is that duffy doesn't really work with pydantic 2.0+, and the specification of dependencies within the wheel says that it can work with any pydantic version greater than 1.6.2.

If I force pydantic to a version lower than 2, it works.

carlosrodfern added a commit to carlosrodfern/duffy that referenced this issue Jul 4, 2023
Fixes: CentOS#864
Signed-off-by: Carlos Rodriguez-Fernandez <carlosrodrifernandez@gmail.com>
@carlosrodfern
Copy link
Contributor Author

carlosrodfern commented Jul 4, 2023

I had a similar error with a PR check on another CentOS project that was installing duffy with pip.
We solved it by fixing the pydantic package version to 1.10.10: CentOS/sig-core-t_functional@c23397a

@carlosrodfern
Copy link
Contributor Author

carlosrodfern commented Jul 4, 2023

It needs an update in the pyproject.toml (see PR #865). The poetry.lock doesn't appear to need an update since it is pinpointing pydantic to a version <2.

nphilipp pushed a commit that referenced this issue Jul 10, 2023
Fixes: #864
Signed-off-by: Carlos Rodriguez-Fernandez <carlosrodrifernandez@gmail.com>
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 a pull request may close this issue.

1 participant