Skip to content

fixes for pydantic 2#52

Open
kaspar030 wants to merge 6 commits intomainfrom
pydantic_2_fixes
Open

fixes for pydantic 2#52
kaspar030 wants to merge 6 commits intomainfrom
pydantic_2_fixes

Conversation

@kaspar030
Copy link
Contributor

@kaspar030 kaspar030 commented Jan 2, 2024

IIUC as pydantic is not pinned, a recent update requires some changes. These are what I needed to get RIOT's ci-staging back up.

edit I won't have time to work on this (e.g., fix the test cases). Please take over. (maybe just pin the working pydantic?)

@kaspar030 kaspar030 requested review from aabadie and bergzand January 2, 2024 13:23
@kaspar030
Copy link
Contributor Author

@aabadie I really don't understand that pydantic backtrace, and the tests.

@aabadie
Copy link
Contributor

aabadie commented Jan 17, 2024

I really don't understand that pydantic backtrace, and the tests.

I understand it as Pydantic validator doesn't like some user_env set in jobmodel:

user_env: Optional[Dict[str, str]] = Field(
        None,
        title="User defined dictionnary of environment variables atteched to the job",
    )

Could the following diff help?

diff --git a/murdock/job.py b/murdock/job.py
index 5095a19..d296b46 100644
--- a/murdock/job.py
+++ b/murdock/job.py
@@ -26,7 +26,7 @@ class MurdockJob:
         config: MurdockSettings = MurdockSettings(),
         trigger: Optional[str] = "api",
         triggered_by: Optional[str] = None,
-        user_env: Optional[dict] = None,
+        user_env: Optional[dict[str,str]] = None,
     ):
         self.trigger: Optional[str] = trigger
         self.triggered_by: Optional[str] = triggered_by

BTW the project is a bit outdated and needs a refresh. I can't even run tox on my machine :)

@kaspar030
Copy link
Contributor Author

Could the following diff help?

Let's see. :))

BTW the project is a bit outdated and needs a refresh. I can't even run tox on my machine :)

I have the same problem ... But this needs some love, I don't think the instance at ci.riot-os.org will survive a restart. 😨

@aabadie
Copy link
Contributor

aabadie commented Jan 17, 2024

I don't think the instance at ci.riot-os.org will survive a restart

It runs in a Docker container so normally if the Python version in the image is 3.10 (or 3.9) and the tests are passing here. It should work. But it's indeed better to make a maintenance pass one day.

kaspar030 and others added 2 commits January 17, 2024 22:47
Co-authored-by: Alexandre Abadie <alexandre.abadie@inria.fr>
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 this pull request may close these issues.

2 participants