Skip to content

Building krr for openSUSE Tumbleweed fails: pydantic.errors.PydanticImportError: BaseSettings has been moved to the pydantic-settings package. #244

@johanneskastl

Description

@johanneskastl

Describe the bug
When trying to package krr for openSUSE Tumbleweed, the build fails due to changes in pydantic.

This seems to be caused by changes in pydantic that krr is not yet adapted to (at least in my not-a-python-expert-only-a-packager opinion):

[  147s] Using alternative krr-3.11 for krr in ./build/flavorbin during Python 3.11 expansions.
[  147s] + export PATH=/home/abuild/rpmbuild/BUILD/krr-1.7.1/build/flavorbin:/usr/local/bin:/usr/bin:/bin
[  147s] + PATH=/home/abuild/rpmbuild/BUILD/krr-1.7.1/build/flavorbin:/usr/local/bin:/usr/bin:/bin
[  147s] ++ '[' -f _current_flavor ']'
[  147s] ++ cat _current_flavor
[  147s] + last_flavor=python311
[  147s] + '[' -z python311 ']'
[  147s] + '[' python311 '!=' python39 ']'
[  147s] + '[' -d build ']'
[  147s] + mv build _build.python311
[  147s] + '[' -d _build.python39 ']'
[  147s] + mv _build.python39 build
[  147s] + echo python39
[  147s] + python_flavor=python39
[  147s] + PYTHONPATH=/home/abuild/rpmbuild/BUILDROOT/python-krr-1.7.1-0.x86_64/usr/lib/python3.9/site-packages
[  147s] + PYTHONDONTWRITEBYTECODE=1
[  147s] + pytest-3.9 --ignore=_build.python39 --ignore=_build.python310 --ignore=_build.python311 -v
[  149s] ImportError while loading conftest '/home/abuild/rpmbuild/BUILD/krr-1.7.1/tests/conftest.py'.
[  149s] tests/conftest.py:8: in <module>
[  149s]     from robusta_krr.api.models import K8sObjectData, PodData, ResourceAllocations
[  149s] ../../BUILDROOT/python-krr-1.7.1-0.x86_64/usr/lib/python3.9/site-packages/robusta_krr/__init__.py:1: in <module>
[  149s]     from .main import run
[  149s] ../../BUILDROOT/python-krr-1.7.1-0.x86_64/usr/lib/python3.9/site-packages/robusta_krr/main.py:17: in <module>
[  149s]     from robusta_krr.core.models.config import Config
[  149s] ../../BUILDROOT/python-krr-1.7.1-0.x86_64/usr/lib/python3.9/site-packages/robusta_krr/core/models/config.py:20: in <module>
[  149s]     class Config(pd.BaseSettings):
[  149s] /usr/lib/python3.9/site-packages/pydantic/__init__.py:374: in __getattr__
[  149s]     return _getattr_migration(attr_name)
[  149s] /usr/lib/python3.9/site-packages/pydantic/_migration.py:296: in wrapper
[  149s]     raise PydanticImportError(
[  149s] E   pydantic.errors.PydanticImportError: `BaseSettings` has been moved to the `pydantic-settings` package. See https://docs.pydantic.dev/2.6/migration/#basesettings-has-moved-to-pydantic-settings for more details.
[  149s] E
[  149s] E   For further information visit https://errors.pydantic.dev/2.6/u/import-error

Kind Regards,
Johannes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions