From 32a7d71ee6a6b510bee288910616bb8087365406 Mon Sep 17 00:00:00 2001 From: Ricardo Madriz Calderon Date: Thu, 14 Nov 2024 17:26:57 -0600 Subject: [PATCH 1/4] Add support for python 3.12 Fixes #416 --- graphene_sqlalchemy/converter.py | 2 +- graphene_sqlalchemy/utils.py | 11 ++++------- setup.py | 1 + tox.ini | 2 +- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/graphene_sqlalchemy/converter.py b/graphene_sqlalchemy/converter.py index efcf3c6..6502412 100644 --- a/graphene_sqlalchemy/converter.py +++ b/graphene_sqlalchemy/converter.py @@ -7,6 +7,7 @@ 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, @@ -14,7 +15,6 @@ interfaces, strategies, ) -from sqlalchemy.ext.hybrid import hybrid_property import graphene from graphene.types.json import JSONString diff --git a/graphene_sqlalchemy/utils.py b/graphene_sqlalchemy/utils.py index 3ba1486..17d774d 100644 --- a/graphene_sqlalchemy/utils.py +++ b/graphene_sqlalchemy/utils.py @@ -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 @@ -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 diff --git a/setup.py b/setup.py index fdace11..43f58f0 100644 --- a/setup.py +++ b/setup.py @@ -17,6 +17,7 @@ "promise>=2.3", "SQLAlchemy>=1.1", "aiodataloader>=0.2.0,<1.0", + "packaging>=23.0", ] tests_require = [ diff --git a/tox.ini b/tox.ini index 9ce901e..08643e7 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = pre-commit,py{37,38,39,310}-sql{12,13,14,20} +envlist = pre-commit,py{37,38,39,310,311,312}-sql{12,13,14,20} skipsdist = true minversion = 3.7.0 From 60e8825997c1b60eae046ab30821d846a1d58f4d Mon Sep 17 00:00:00 2001 From: Ricardo Madriz Calderon Date: Thu, 14 Nov 2024 17:30:30 -0600 Subject: [PATCH 2/4] Remove python 3.7 --- tox.ini | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 08643e7..0c04aa3 100644 --- a/tox.ini +++ b/tox.ini @@ -1,14 +1,15 @@ [tox] -envlist = pre-commit,py{37,38,39,310,311,312}-sql{12,13,14,20} +envlist = pre-commit,py{38,39,310,311,312}-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 [gh-actions:env] SQLALCHEMY = From 39ed1ec5e3215d184abf0affc56ef5f6c1210aca Mon Sep 17 00:00:00 2001 From: Ricardo Madriz Date: Sun, 17 Nov 2024 17:24:05 -0600 Subject: [PATCH 3/4] Drop python 3.8, add 3.13 --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 0c04aa3..1e2f7ca 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = pre-commit,py{38,39,310,311,312}-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 From 37cda420b5cb3e61a233a101f3026c0d72b9210c Mon Sep 17 00:00:00 2001 From: Erik Wrede Date: Thu, 5 Dec 2024 12:52:40 +0100 Subject: [PATCH 4/4] housekeeping: ci 3.9-3.13 --- .github/workflows/tests.yml | 2 +- setup.py | 7 ++++--- tox.ini | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c471166..f03a405 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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 diff --git a/setup.py b/setup.py index 43f58f0..33eabcb 100644 --- a/setup.py +++ b/setup.py @@ -49,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={ diff --git a/tox.ini b/tox.ini index 1e2f7ca..6ec4699 100644 --- a/tox.ini +++ b/tox.ini @@ -5,11 +5,11 @@ minversion = 3.7.0 [gh-actions] python = - 3.8: py38 3.9: py39 3.10: py310 3.11: py311 3.12: py312 + 3.13: py313 [gh-actions:env] SQLALCHEMY =