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

fix: Upgrade to Python 3.12 #134

Merged
merged 11 commits into from
Sep 18, 2024
Merged

fix: Upgrade to Python 3.12 #134

merged 11 commits into from
Sep 18, 2024

Conversation

faucomte97
Copy link
Contributor

@faucomte97 faucomte97 commented Sep 18, 2024

This change is Reviewable

@faucomte97 faucomte97 self-assigned this Sep 18, 2024
@faucomte97 faucomte97 linked an issue Sep 18, 2024 that may be closed by this pull request
Copy link
Contributor

@SKairinos SKairinos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 19 of 19 files at r1, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @faucomte97)


codeforlife/tests/model_serializer.py line 128 at r1 (raw file):

                data[field] = getattr(value, "id")

        self.assertEqual(model_to_dict(model), {**model_to_dict(model), **data})

Instead, replace this with

model_dict = {
    field: value
    for field, value in model.__dict__.items()
    if not field.startswith("_")
}
self.assertDictEqual(model_dict | data, model_dict)

Code quote:

self.assertEqual(model_to_dict(model), {**model_to_dict(model), **data})

codeforlife/tests/model_view_set.py line 748 at r1 (raw file):

        (self.assertEqual if contains_subset else self.assertDictEqual)(
            json_model, serialized_model
        )

Instead, replace this with

self.assertDictEqual(
            serialized_model | json_model if contains_subset else json_model,
            serialized_model,
        )

Code quote:

        (self.assertEqual if contains_subset else self.assertDictEqual)(
            json_model, serialized_model
        )

codeforlife/tests/model_view_set.py line 824 at r1 (raw file):

            actual_serializer_context,
            actual_serializer_context | serializer_context,
        )

Instead, replace this with

self.assertDictEqual(
            actual_serializer_context | serializer_context,
            actual_serializer_context,
        )

Code quote:

        self.assertEqual(
            actual_serializer_context,
            actual_serializer_context | serializer_context,
        )

Copy link
Contributor Author

@faucomte97 faucomte97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 17 of 19 files reviewed, 3 unresolved discussions (waiting on @SKairinos)


codeforlife/tests/model_serializer.py line 128 at r1 (raw file):

Previously, SKairinos (Stefan Kairinos) wrote…

Instead, replace this with

model_dict = {
    field: value
    for field, value in model.__dict__.items()
    if not field.startswith("_")
}
self.assertDictEqual(model_dict | data, model_dict)

Done.


codeforlife/tests/model_view_set.py line 748 at r1 (raw file):

Previously, SKairinos (Stefan Kairinos) wrote…

Instead, replace this with

self.assertDictEqual(
            serialized_model | json_model if contains_subset else json_model,
            serialized_model,
        )

Done.


codeforlife/tests/model_view_set.py line 824 at r1 (raw file):

Previously, SKairinos (Stefan Kairinos) wrote…

Instead, replace this with

self.assertDictEqual(
            actual_serializer_context | serializer_context,
            actual_serializer_context,
        )

Done.

Copy link
Contributor

@SKairinos SKairinos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 2 files at r2, 2 of 3 files at r3, 1 of 1 files at r4, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @faucomte97)

@faucomte97 faucomte97 merged commit aed00bf into main Sep 18, 2024
5 of 6 checks passed
@faucomte97 faucomte97 deleted the python312 branch September 18, 2024 13:51
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.

Upgrade to Python 3.12
2 participants