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.12 #417

Merged
merged 4 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
max-parallel: 10
matrix:
sql-alchemy: [ "1.2", "1.3", "1.4","2.0" ]
python-version: [ "3.7", "3.8", "3.9", "3.10" ]
python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion graphene_sqlalchemy/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@

from sqlalchemy import types as sqa_types
from sqlalchemy.dialects import postgresql
from sqlalchemy.ext.hybrid import hybrid_property
from sqlalchemy.orm import (
ColumnProperty,
RelationshipProperty,
class_mapper,
interfaces,
strategies,
)
from sqlalchemy.ext.hybrid import hybrid_property

import graphene
from graphene.types.json import JSONString
Expand Down
11 changes: 4 additions & 7 deletions graphene_sqlalchemy/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
import warnings
from collections import OrderedDict
from functools import _c3_mro
from importlib.metadata import version as get_version
from typing import Any, Callable, Dict, Optional

import pkg_resources
from packaging import version
from sqlalchemy import select
from sqlalchemy.exc import ArgumentError
from sqlalchemy.orm import class_mapper, object_mapper
Expand All @@ -22,16 +23,12 @@ def get_nullable_type(_type):

def is_sqlalchemy_version_less_than(version_string):
"""Check the installed SQLAlchemy version"""
return pkg_resources.get_distribution(
"SQLAlchemy"
).parsed_version < pkg_resources.parse_version(version_string)
return version.parse(get_version("SQLAlchemy")) < version.parse(version_string)


def is_graphene_version_less_than(version_string): # pragma: no cover
"""Check the installed graphene version"""
return pkg_resources.get_distribution(
"graphene"
).parsed_version < pkg_resources.parse_version(version_string)
return version.parse(get_version("graphene")) < version.parse(version_string)


SQL_VERSION_HIGHER_EQUAL_THAN_1_4 = False
Expand Down
8 changes: 5 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"promise>=2.3",
"SQLAlchemy>=1.1",
"aiodataloader>=0.2.0,<1.0",
"packaging>=23.0",
]

tests_require = [
Expand Down Expand Up @@ -48,13 +49,14 @@
"Intended Audience :: Developers",
"Topic :: Software Development :: Libraries",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: Implementation :: PyPy",
],
keywords="api graphql protocol rest relay graphene",
keywords="api graphql protocol rest relay graphene sqlalchemy",
packages=find_packages(exclude=["tests"]),
install_requires=requirements,
extras_require={
Expand Down
7 changes: 4 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
[tox]
envlist = pre-commit,py{37,38,39,310}-sql{12,13,14,20}
envlist = pre-commit,py{39,310,311,312,313}-sql{12,13,14,20}
skipsdist = true
minversion = 3.7.0

[gh-actions]
python =
3.7: py37
3.8: py38
3.9: py39
3.10: py310
3.11: py311
3.12: py312
3.13: py313

[gh-actions:env]
SQLALCHEMY =
Expand Down
Loading