From d9f3c04f19eefa1b7801612089b677b860e04153 Mon Sep 17 00:00:00 2001 From: kashewnuts Date: Thu, 1 Feb 2024 17:57:03 +0900 Subject: [PATCH] support Python3.10 over & Django4.2 --- .github/workflows/tests.yml | 8 ++++---- .hgignore | 19 ------------------- CHANGES.rst | 12 ++++++++++++ README.rst | 7 +++---- beproud/django/notify/models.py | 6 ++---- setup.py | 13 +++++++------ tox.ini | 30 ++++++++++++++++++++---------- 7 files changed, 48 insertions(+), 47 deletions(-) delete mode 100644 .hgignore diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5ae22dd..c22982a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,16 +14,16 @@ jobs: # 並列して実行する各ジョブのPythonバージョン strategy: matrix: - python-version: ['3.6', '3.9'] - django-version: ['2.2', '3.2'] + python-version: ['3.9', '3.10', '3.11', '3.12'] + django-version: ['3.2', '4.2'] steps: # ソースコードをチェックアウト - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 # ジョブのPython環境を設定 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} diff --git a/.hgignore b/.hgignore deleted file mode 100644 index a808144..0000000 --- a/.hgignore +++ /dev/null @@ -1,19 +0,0 @@ -syntax: glob -*.orig -*.rej -*~ -*.bak -*.marks -*.o -*.pyc -*.swp -*.egg-info -*.egg -.tox -build -dist -pip-log.txt -docs/*/build - -syntax: regexp -.*\#.*\#$ diff --git a/CHANGES.rst b/CHANGES.rst index 3a19a67..e0e1606 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,6 +1,18 @@ ChangeLog ========= +0.49 (2024-02-XX) +=================== + +Features: + +* Add Support Python3.10~3.12, Django4.2 + +Incompatible Changes: + +* Drop Python3.6 & Django2.2 +* Migrate from django-jsonfield to models.JSONField + 0.48 (2022-04-11) =================== diff --git a/README.rst b/README.rst index 5a8adc5..8e43d6f 100644 --- a/README.rst +++ b/README.rst @@ -7,11 +7,10 @@ Requirements ============ -* Python (3.6, 3.9) -* Celery (4.2, 5.1, 5.2) -* Django (2.2, 3.2) +* Python (3.9, 3.10, 3.11, 3.12) +* Celery (5.2, 5.3) +* Django (3.2, 4.2) * six -* django-jsonfield (1.0.1) Links ================= diff --git a/beproud/django/notify/models.py b/beproud/django/notify/models.py index 9e3b6ab..313c147 100644 --- a/beproud/django/notify/models.py +++ b/beproud/django/notify/models.py @@ -3,11 +3,9 @@ from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes.fields import GenericForeignKey -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from django.db import models -import jsonfield - from beproud.django.notify.api import _get_media_map __all__ = ( @@ -42,7 +40,7 @@ class Notification(models.Model): notify_type = models.CharField(_('notify type'), max_length=100, db_index=True) media = models.CharField(_('media'), max_length=100, choices=MediaChoices(), db_index=True) - extra_data = jsonfield.JSONField(_('extra data'), null=True, blank=True) + extra_data = models.JSONField(_('extra data'), null=True, blank=True) ctime = models.DateTimeField(_('created'), auto_now_add=True, db_index=True) diff --git a/setup.py b/setup.py index 7bfab3c..970fd3a 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ def read_file(filename): long_description=read_file('README.rst'), long_description_content_type="text/x-rst", url='https://github.com/beproud/bpnotify/', - python_requires='>=3.6', + python_requires='>=3.9', classifiers=[ 'Development Status :: 3 - Alpha', 'Environment :: Plugins', @@ -30,10 +30,12 @@ def read_file(filename): 'License :: OSI Approved :: BSD License', 'Programming Language :: Python', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', 'Framework :: Django', - 'Framework :: Django :: 2.2', + 'Framework :: Django :: 3.2', 'Framework :: Django :: 3.2', 'Topic :: Software Development :: Libraries :: Python Modules', ], @@ -42,9 +44,8 @@ def read_file(filename): namespace_packages=['beproud', 'beproud.django'], test_suite='tests.main', install_requires=[ - 'Django>=2.2', - 'django-jsonfield>=1.0.1', - 'Celery>=4.2', + 'Django>=3.2', + 'Celery>=5.2', 'six', ], zip_safe=False, diff --git a/tox.ini b/tox.ini index 4512907..db51874 100644 --- a/tox.ini +++ b/tox.ini @@ -1,30 +1,40 @@ # content of: tox.ini , put in same dir as setup.py [tox] -# celery5.2はPython3.7以降に対応しているため、Python3.6のテストではcelery 5.1までを使用する -envlist = py36-django{22,32}-celery{42,51},py39-django{22,32}-celery{51,52} +envlist = py{39,310,311,312}-dj{32,42}-celery{52,53} +skipsdist = True [testenv] basepython = - py36: python3.6 py39: python3.9 + py310: python3.10 + py311: python3.11 + py312: python3.12 + +[pytest] +test_paths = tests test_*.py *_test.py +django_find_project = false +DJANGO_SETTINGS_MODULE = test_settings deps = + pytest + pytest-django six - django22: Django~=2.2.12 - django32: Django~=3.2.1 - celery42: celery>=4.2,<4.3 - celery51: celery>=5.0,<5.2 + dj32: Django>=3.2,<4.0 + dj42: Django>=4.2,<5.0 celery52: celery>=5.2,<5.3 + celery53: celery>=5.3,<5.4 -commands=python setup.py test +commands=pytest {posargs} # tox-gh-actionsパッケージの設定 [gh-actions] python = - 3.6: py36 3.9: py39 + 3.10: py310 + 3.11: py311 + 3.12: py312 [gh-actions:env] DJANGO = - 2.2: django22 3.2: django32 + 4.2: django42