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

Add support for Python 3.11 #1365

Merged
merged 3 commits into from May 4, 2023
Merged

Add support for Python 3.11 #1365

merged 3 commits into from May 4, 2023

Conversation

ulgens
Copy link
Collaborator

@ulgens ulgens commented Oct 31, 2022

No description provided.

@ulgens ulgens self-assigned this Oct 31, 2022
@firaskafri
Copy link
Collaborator

@ulgens I guess tests are failing

@yuekui
Copy link
Contributor

yuekui commented Nov 10, 2022

#1368 should fix all the failed tests.

@ulgens
Copy link
Collaborator Author

ulgens commented Nov 20, 2022

@firaskafri Are these close - reopens are on purpose or do we have a bug on Github's side?

@firaskafri
Copy link
Collaborator

@ulgens something is wrong with tests other than the failures, closed and reopened the PR to trigger them

@ulgens
Copy link
Collaborator Author

ulgens commented Nov 22, 2022

@firaskafri Please don't 🙂 . It creates misleading notifications for anyone following the PR and doesn't make much on fixing the issue. I'll check this one on the weekend.

@firaskafri
Copy link
Collaborator

@firaskafri Please don't 🙂 . It creates misleading notifications for anyone following the PR and doesn't make much on fixing the issue. I'll check this one on the weekend.

The test pipeline gets stuck sometimes and that is unrelated to the the actual code failure, that was the quick way to re trigger the tests. Any suggestions to fix this?

@ulgens
Copy link
Collaborator Author

ulgens commented Nov 27, 2022

@firaskafri Failing tasks have "re-run" option on their Actions page. I believe it gives a cleaner result.
CleanShot 2022-11-28 at 01 06 14@2x

@ulgens
Copy link
Collaborator Author

ulgens commented Nov 27, 2022

Tests look a bit better now. I'll check that last failing test as soon as possible.

@firaskafri
Copy link
Collaborator

@ulgens test for 3.11 are failing

@firaskafri firaskafri self-requested a review April 7, 2023 10:26
@firaskafri
Copy link
Collaborator

firaskafri commented Apr 10, 2023

It seems that Schema() behavior changes when using python 3.11 which is breaking 3.11 tests. I could pin point the issue in enums:

In python 3.11, schema generates this:

            type Query {
              pet: PetModelKind
            }

            type PetModelKind {
              id: ID!
              kind: CustomEnumKind!
            }

            enum CustomEnumKind {
              \"""Cat\"""
              CAT

              \"""Dog\"""
              DOG
            }"""

While in older python versions:

            type Query {
              pet: PetModelKind
            }

            type PetModelKind {
              id: ID!
              kind: CustomEnumKind!
            }

--->      \"""An enumeration.\"""
            enum CustomEnumKind {
              \"""Cat\"""
              CAT

              \"""Dog\"""
              DOG
            }"""

@firaskafri
Copy link
Collaborator

firaskafri commented Apr 11, 2023

it seems that enum.__doc__ behaviour changed in python 3.11 which causing description = description or enum.__doc__ to fail in graphene. Hopefully graphql-python/graphene#1502 would be a sufficient fix.

@ulgens
Copy link
Collaborator Author

ulgens commented May 4, 2023

Thanks for the fix guys. I rebased the branch for clarity.

@firaskafri
Copy link
Collaborator

firaskafri commented May 4, 2023

Thanks for the fix guys. I rebased the branch for clarity.

Glad to see you back @ulgens !

@firaskafri firaskafri merged commit 8540a93 into main May 4, 2023
24 checks passed
@firaskafri firaskafri deleted the python311 branch May 4, 2023 12:19
superlevure pushed a commit to loft-orbital/graphene-django that referenced this pull request Jul 19, 2023
* Add support for Python 3.11

* Fix Python 3.11 compatibility matrix

* Add temporary fix for default enum description

---------

Co-authored-by: Firas Kafri <firaskafri@Firass-MacBook-Pro-2.local>
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.

None yet

5 participants