Skip to content

Commit a6161dd

Browse files
richin13erikwrede
andauthored
hoursekeeping: add support for python 3.12 (#417)
* Add support for python 3.12 Fixes #416 * Remove python 3.7 * Drop python 3.8, add 3.13 * housekeeping: ci 3.9-3.13 --------- Co-authored-by: Erik Wrede <[email protected]>
1 parent eb9c663 commit a6161dd

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

.github/workflows/tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
max-parallel: 10
1616
matrix:
1717
sql-alchemy: [ "1.2", "1.3", "1.4","2.0" ]
18-
python-version: [ "3.7", "3.8", "3.9", "3.10" ]
18+
python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13"]
1919

2020
steps:
2121
- uses: actions/checkout@v3

graphene_sqlalchemy/converter.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77

88
from sqlalchemy import types as sqa_types
99
from sqlalchemy.dialects import postgresql
10+
from sqlalchemy.ext.hybrid import hybrid_property
1011
from sqlalchemy.orm import (
1112
ColumnProperty,
1213
RelationshipProperty,
1314
class_mapper,
1415
interfaces,
1516
strategies,
1617
)
17-
from sqlalchemy.ext.hybrid import hybrid_property
1818

1919
import graphene
2020
from graphene.types.json import JSONString

graphene_sqlalchemy/utils.py

+4-7
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
import warnings
44
from collections import OrderedDict
55
from functools import _c3_mro
6+
from importlib.metadata import version as get_version
67
from typing import Any, Callable, Dict, Optional
78

8-
import pkg_resources
9+
from packaging import version
910
from sqlalchemy import select
1011
from sqlalchemy.exc import ArgumentError
1112
from sqlalchemy.orm import class_mapper, object_mapper
@@ -22,16 +23,12 @@ def get_nullable_type(_type):
2223

2324
def is_sqlalchemy_version_less_than(version_string):
2425
"""Check the installed SQLAlchemy version"""
25-
return pkg_resources.get_distribution(
26-
"SQLAlchemy"
27-
).parsed_version < pkg_resources.parse_version(version_string)
26+
return version.parse(get_version("SQLAlchemy")) < version.parse(version_string)
2827

2928

3029
def is_graphene_version_less_than(version_string): # pragma: no cover
3130
"""Check the installed graphene version"""
32-
return pkg_resources.get_distribution(
33-
"graphene"
34-
).parsed_version < pkg_resources.parse_version(version_string)
31+
return version.parse(get_version("graphene")) < version.parse(version_string)
3532

3633

3734
SQL_VERSION_HIGHER_EQUAL_THAN_1_4 = False

setup.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"promise>=2.3",
1818
"SQLAlchemy>=1.1",
1919
"aiodataloader>=0.2.0,<1.0",
20+
"packaging>=23.0",
2021
]
2122

2223
tests_require = [
@@ -48,13 +49,14 @@
4849
"Intended Audience :: Developers",
4950
"Topic :: Software Development :: Libraries",
5051
"Programming Language :: Python :: 3",
51-
"Programming Language :: Python :: 3.7",
52-
"Programming Language :: Python :: 3.8",
5352
"Programming Language :: Python :: 3.9",
5453
"Programming Language :: Python :: 3.10",
54+
"Programming Language :: Python :: 3.11",
55+
"Programming Language :: Python :: 3.12",
56+
"Programming Language :: Python :: 3.13",
5557
"Programming Language :: Python :: Implementation :: PyPy",
5658
],
57-
keywords="api graphql protocol rest relay graphene",
59+
keywords="api graphql protocol rest relay graphene sqlalchemy",
5860
packages=find_packages(exclude=["tests"]),
5961
install_requires=requirements,
6062
extras_require={

tox.ini

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
[tox]
2-
envlist = pre-commit,py{37,38,39,310}-sql{12,13,14,20}
2+
envlist = pre-commit,py{39,310,311,312,313}-sql{12,13,14,20}
33
skipsdist = true
44
minversion = 3.7.0
55

66
[gh-actions]
77
python =
8-
3.7: py37
9-
3.8: py38
108
3.9: py39
119
3.10: py310
10+
3.11: py311
11+
3.12: py312
12+
3.13: py313
1213

1314
[gh-actions:env]
1415
SQLALCHEMY =

0 commit comments

Comments
 (0)