From ee0e458a625e4f715976128c66ac1200453c7a54 Mon Sep 17 00:00:00 2001 From: Zeta Date: Fri, 15 Dec 2023 13:26:49 -0300 Subject: [PATCH 1/7] Add support django50 and python3.12 --- .circleci/config.yml | 11 +++++++++++ setup.py | 2 +- tox.ini | 6 ++++-- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 64e60c30..7957bf5f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -106,6 +106,17 @@ jobs: extra: test - run-tests: pyversion: 311 + + test-python312: + executor: + name: python + version: "3.12" + steps: + - checkout + - install-dependencies: + extra: test + - run-tests: + pyversion: 312 - store_test_results: path: reports - run: diff --git a/setup.py b/setup.py index b3217fb3..c3431e27 100644 --- a/setup.py +++ b/setup.py @@ -68,7 +68,7 @@ def run(self): ], python_requires=">=3.6", install_requires=[ - "Django>=2.0,<5.0", + "Django>=2.0,<6.0", "python-dateutil>=2.8.0,<=3.0.0", ], extras_require={ diff --git a/tox.ini b/tox.ini index 3e229d0d..62473b6b 100644 --- a/tox.ini +++ b/tox.ini @@ -2,8 +2,9 @@ envlist = {py36,py37}-dj{20,21,22,30,31,32}-psycopg{28,29} {py38,py39,py310}-dj{21,22,30,31,32,40}-psycopg{28,29} - {py38,py39,py310,py311}-dj{41}-psycopg{28,29} - {py38,py39,py310,py311}-dj{42}-psycopg{28,29,31} + {py38,py39,py310,py311,py312}-dj{41}-psycopg{28,29} + {py38,py39,py310,py311,py312}-dj{42,50}-psycopg{28,29,31} + [testenv] deps = @@ -16,6 +17,7 @@ deps = dj40: Django~=4.0.0 dj41: Django~=4.1.0 dj42: Django~=4.2.0 + dj50: Django~=5.0.0 psycopg28: psycopg2[binary]~=2.8 psycopg29: psycopg2[binary]~=2.9 psycopg31: psycopg[binary]~=3.1 From 1754f7e572e7cd663aeb0202efd5d2c0255bccdb Mon Sep 17 00:00:00 2001 From: Zeta Date: Fri, 15 Dec 2023 13:28:30 -0300 Subject: [PATCH 2/7] circle ci python312 support --- .circleci/config.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7957bf5f..003412c6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -199,6 +199,12 @@ workflows: only: /.*/ branches: only: /.*/ + - test-python312: + filters: + tags: + only: /.*/ + branches: + only: /.*/ - analysis: filters: tags: From 48095ad45fc6eaed593995cfbae5aeb620ff5fa1 Mon Sep 17 00:00:00 2001 From: Zeta Date: Fri, 15 Dec 2023 13:41:46 -0300 Subject: [PATCH 3/7] python3.12-buster is still in release candidate --- .circleci/config.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 003412c6..d71d4ed6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -12,6 +12,17 @@ executors: POSTGRES_DB: 'psqlextra' POSTGRES_USER: 'psqlextra' POSTGRES_PASSWORD: 'psqlextra' + python-rc: + parameters: + version: + type: string + docker: + - image: python:<< parameters.version >>-rc-buster + - image: postgres:16.0 + environment: + POSTGRES_DB: 'psqlextra' + POSTGRES_USER: 'psqlextra' + POSTGRES_PASSWORD: 'psqlextra' commands: install-dependencies: @@ -109,7 +120,7 @@ jobs: test-python312: executor: - name: python + name: python-rc version: "3.12" steps: - checkout From 19959a41337fab2d29aee7d26c941044021ef55f Mon Sep 17 00:00:00 2001 From: Zeta Date: Fri, 15 Dec 2023 15:01:45 -0300 Subject: [PATCH 4/7] fix module distuitl import error --- setup.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index c3431e27..45af2cd6 100644 --- a/setup.py +++ b/setup.py @@ -1,13 +1,21 @@ -import distutils.cmd import os import subprocess from setuptools import find_packages, setup +try: + # distutils module is deprecated since Python 3.10 + # and removed in Python 3.12 + # https://peps.python.org/pep-0632/ + import distutils.cmd as distutils_cmd +except ImportError: + import setuptools.command as distutils_cmd + + exec(open("psqlextra/_version.py").read()) -class BaseCommand(distutils.cmd.Command): +class BaseCommand(distutils_cmd.Command): user_options = [] def initialize_options(self): From f0243f82c54cb03e0fc1c2d3edd050b7015787a8 Mon Sep 17 00:00:00 2001 From: Zeta Date: Fri, 22 Dec 2023 15:32:41 -0300 Subject: [PATCH 5/7] use setuptools distutils --- setup.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/setup.py b/setup.py index 45af2cd6..2cd90e20 100644 --- a/setup.py +++ b/setup.py @@ -4,18 +4,14 @@ from setuptools import find_packages, setup try: - # distutils module is deprecated since Python 3.10 - # and removed in Python 3.12 - # https://peps.python.org/pep-0632/ - import distutils.cmd as distutils_cmd + import distutils.cmd.Command as Command except ImportError: - import setuptools.command as distutils_cmd - + import setuptools.Command as Command exec(open("psqlextra/_version.py").read()) -class BaseCommand(distutils_cmd.Command): +class BaseCommand(Command): user_options = [] def initialize_options(self): @@ -71,6 +67,7 @@ def run(self): "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", ], From 622faef0a26c5698b1d598fc883a898cb99e4beb Mon Sep 17 00:00:00 2001 From: Zeta Date: Fri, 22 Dec 2023 15:48:45 -0300 Subject: [PATCH 6/7] Django 5 supported by python grather than 3.10 --- tox.ini | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 62473b6b..a2063d78 100644 --- a/tox.ini +++ b/tox.ini @@ -3,8 +3,9 @@ envlist = {py36,py37}-dj{20,21,22,30,31,32}-psycopg{28,29} {py38,py39,py310}-dj{21,22,30,31,32,40}-psycopg{28,29} {py38,py39,py310,py311,py312}-dj{41}-psycopg{28,29} - {py38,py39,py310,py311,py312}-dj{42,50}-psycopg{28,29,31} - + {py38,py39,py310,py311,py312}-dj{42}-psycopg{28,29,31} + {py310,py311,py312}-dj{50}-psycopg{31} + [testenv] deps = From e2f54dd4d019d6a7d90d12065d316f60721e8ac2 Mon Sep 17 00:00:00 2001 From: Zeta Date: Fri, 22 Dec 2023 15:51:01 -0300 Subject: [PATCH 7/7] fix imports --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 2cd90e20..a26439d5 100644 --- a/setup.py +++ b/setup.py @@ -4,9 +4,9 @@ from setuptools import find_packages, setup try: - import distutils.cmd.Command as Command + from distutils.cmd import Command as Command except ImportError: - import setuptools.Command as Command + from setuptools import Command as Command exec(open("psqlextra/_version.py").read())