pvarki / python-rasenmaeher-api

1 stars 0 forks source link

rmlocal-rmapi-1: pydantic.errors.PydanticImportError: `BaseSettings` has been moved to the `pydantic-settings` package #32

Closed aarne33 closed 1 year ago

aarne33 commented 1 year ago

The complete error stack trace is visible in this repo's github actions visible at: https://github.com/pvarki/docker-rasenmaeher-integration/actions/runs/5990117815/job/16247079829

Here is a snippet taken from the complete trace:

rmlocal-rmapi-1 | File "", line 940, in exec_module rmlocal-rmapi-1 | File "", line 241, in _call_with_frames_removed rmlocal-rmapi-1 | File "/usr/local/lib/python3.11/site-packages/rasenmaeher_api/web/application.py", line 5, in rmlocal-rmapi-1 | from rasenmaeher_api.settings import settings rmlocal-rmapi-1 | File "/usr/local/lib/python3.11/site-packages/rasenmaeher_api/settings.py", line 9, in rmlocal-rmapi-1 | from pydantic import BaseSettings rmlocal-rmapi-1 | File "/usr/local/lib/python3.11/site-packages/pydantic/init.py", line 210, in getattr rmlocal-rmapi-1 | return _getattr_migration(attr_name) rmlocal-rmapi-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ rmlocal-rmapi-1 | File "/usr/local/lib/python3.11/site-packages/pydantic/_migration.py", line 289, in wrapper rmlocal-rmapi-1 | raise PydanticImportError( rmlocal-rmapi-1 | pydantic.errors.PydanticImportError: BaseSettingshas been moved to thepydantic-settings package. See https://docs.pydantic.dev/2.3/migration/#basesettings-has-moved-to-pydantic-settings for more details. rmlocal-rmapi-1 | rmlocal-rmapi-1 | rmlocal-rmapi-1 | For further information visit https://errors.pydantic.dev/2.3/u/import-error rmlocal-rmapi-1 | [2023-08-27 09:35:45 +0000] [10] [INFO] Worker exiting (pid: 10)

aarne33 commented 1 year ago

@rambo @Aciid @karppo this issue seems to be originating from python-rasenmaeher-api-repo. Found this related to the issue: https://docs.pydantic.dev/2.3/migration/#basesettings-has-moved-to-pydantic-settings Not sure why this issue doesn't occur locally on my laptop nor in the ci-action for rmdev. Only problem is the ci-action for rmlocal.

rambo commented 1 year ago

https://github.com/pvarki/python-rasenmaeher-api/pull/31/commits/69c38c1b1ae9ff36ab241d7c137b682c85227b7d fixes this, cherry pick to a hotfix branch if in a hurry. If doing that pick also https://github.com/pvarki/python-rasenmaeher-api/pull/31/commits/af08f0228cc4b1f3544467e52c5752355dd8e663

aarne33 commented 1 year ago

Tried it, but the error still exists. Maybe it is better to wait for the complete branch into the master just in case, and to the retest again. The "test-steps" conducted below as FYI.

  1. cherry-pick-branch: issue/32
  2. test-branch: test/32
  3. git-action-test: github-action build