Skip to content

Commit 8540a93

Browse files
ulgensFiras Kafri
and
Firas Kafri
authored
Add support for Python 3.11 (#1365)
* 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>
1 parent af8888f commit 8540a93

File tree

7 files changed

+16
-6
lines changed

7 files changed

+16
-6
lines changed

.github/workflows/deploy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ jobs:
1111

1212
steps:
1313
- uses: actions/checkout@v3
14-
- name: Set up Python 3.10
14+
- name: Set up Python 3.11
1515
uses: actions/setup-python@v4
1616
with:
17-
python-version: '3.10'
17+
python-version: '3.11'
1818
- name: Build wheel and source tarball
1919
run: |
2020
pip install wheel

.github/workflows/lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ jobs:
88

99
steps:
1010
- uses: actions/checkout@v3
11-
- name: Set up Python 3.10
11+
- name: Set up Python 3.11
1212
uses: actions/setup-python@v4
1313
with:
14-
python-version: '3.10'
14+
python-version: '3.11'
1515
- name: Install dependencies
1616
run: |
1717
python -m pip install --upgrade pip

.github/workflows/tests.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ jobs:
1313
include:
1414
- django: "3.2"
1515
python-version: "3.7"
16+
- django: "4.1"
17+
python-version: "3.11"
1618
steps:
1719
- uses: actions/checkout@v3
1820
- name: Set up Python ${{ matrix.python-version }}

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
default_language_version:
2-
python: python3.10
2+
python: python3.11
33
repos:
44
- repo: https://github.com/pre-commit/pre-commit-hooks
55
rev: v4.4.0

graphene_django/converter.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,12 @@ class EnumWithDescriptionsType:
9696
def description(self):
9797
return str(named_choices_descriptions[self.name])
9898

99-
return_type = Enum(name, list(named_choices), type=EnumWithDescriptionsType)
99+
return_type = Enum(
100+
name,
101+
list(named_choices),
102+
type=EnumWithDescriptionsType,
103+
description="An enumeration.", # Temporary fix until https://github.com/graphql-python/graphene/pull/1502 is merged
104+
)
100105
return return_type
101106

102107

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
"Programming Language :: Python :: 3.8",
5252
"Programming Language :: Python :: 3.9",
5353
"Programming Language :: Python :: 3.10",
54+
"Programming Language :: Python :: 3.11",
5455
"Programming Language :: Python :: Implementation :: PyPy",
5556
"Framework :: Django",
5657
"Framework :: Django :: 3.2",

tox.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
envlist =
33
py{37,38,39,310}-django32,
44
py{38,39,310}-django{40,41,main},
5+
py311-django{41,main}
56
pre-commit
67

78
[gh-actions]
@@ -10,6 +11,7 @@ python =
1011
3.8: py38
1112
3.9: py39
1213
3.10: py310
14+
3.11: py311
1315

1416
[gh-actions:env]
1517
DJANGO =

0 commit comments

Comments
 (0)