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

Pydantic V2 Update leads to breaking changes #297

Closed
marlon-luca-bu opened this issue Jun 12, 2024 · 0 comments
Closed

Pydantic V2 Update leads to breaking changes #297

marlon-luca-bu opened this issue Jun 12, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@marlon-luca-bu
Copy link
Contributor

Please describe the bug

Apparently, the update from pydantic V1 to pydantic V2 contained major (breaking) changes which results in being not able to start any athena module

To Reproduce

  1. Select any athena module
  2. Delete the poetry.lock file
  3. Execute poetry install
  4. Try to start the module

Expected behavior

Athena should start without any errors

Screenshots

No response

What module is this bug related to?

Other (specify in "Additional context")

What browsers are you seeing the problem on?

No response

Operating System

Windows 11

Additional context

Bug is related to all modules

Relevant log output

C:\Users\Marlon\Desktop\Athena\venv\Lib\site-packages\pydantic\_internal\_config.py:334: UserWarning: Valid config keys have changed in V2:
* 'allow_population_by_field_name' has been renamed to 'populate_by_name'
  warnings.warn(message, UserWarning)
C:\Users\Marlon\Desktop\Athena\venv\Lib\site-packages\pydantic\_internal\_config.py:334: UserWarning: Valid config keys have changed in V2:
* 'orm_mode' has been renamed to 'from_attributes'
  warnings.warn(message, UserWarning)
C:\Users\Marlon\Desktop\Athena\venv\Lib\site-packages\pydantic\_internal\_config.py:334: UserWarning: Valid config keys have changed in V2:
* 'allow_population_by_field_name' has been renamed to 'populate_by_name'
* 'orm_mode' has been renamed to 'from_attributes'
  warnings.warn(message, UserWarning)
Traceback (most recent call last):
  File "C:\Users\Marlon\Desktop\Athena\module_programming_apted\module_programming_apted\__main__.py", line 7, in <module>
    from module_programming_apted.convert_code_to_ast.get_feedback_methods import get_feedback_method
  File "C:\Users\Marlon\Desktop\Athena\module_programming_apted\module_programming_apted\convert_code_to_ast\get_feedback_methods.py", line 3, in <module>
    from athena.programming import Submission, Feedback
  File "C:\Users\Marlon\Desktop\Athena\athena\athena\__init__.py", line 5, in <module>
    from .app import app
  File "C:\Users\Marlon\Desktop\Athena\athena\athena\app.py", line 15, in <module>
    from .module_config import get_module_config
  File "C:\Users\Marlon\Desktop\Athena\athena\athena\module_config.py", line 9, in <module>
    from .schemas.exercise_type import ExerciseType
  File "C:\Users\Marlon\Desktop\Athena\athena\athena\schemas\__init__.py", line 11, in <module>
    from .programming_exercise import ProgrammingExercise
  File "C:\Users\Marlon\Desktop\Athena\athena\athena\schemas\programming_exercise.py", line 10, in <module>
    class ProgrammingExercise(Exercise):
  File "C:\Users\Marlon\Desktop\Athena\athena\athena\schemas\programming_exercise.py", line 13, in ProgrammingExercise
    type: ExerciseType = Field(ExerciseType.programming, const=True)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Marlon\Desktop\Athena\venv\Lib\site-packages\pydantic\fields.py", line 766, in Field
    raise PydanticUserError('`const` is removed, use `Literal` instead', code='removed-kwargs')
pydantic.errors.PydanticUserError: `const` is removed, use `Literal` instead
@marlon-luca-bu marlon-luca-bu added the bug Something isn't working label Jun 12, 2024
@marlon-luca-bu marlon-luca-bu linked a pull request Jun 15, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants