Skip to content

Commit

Permalink
support Python3.10 over & Django4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
kashewnuts committed Feb 2, 2024
1 parent 4c7694e commit ef76168
Show file tree
Hide file tree
Showing 14 changed files with 158 additions and 204 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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@v5
with:
python-version: ${{ matrix.python-version }}

Expand Down
19 changes: 0 additions & 19 deletions .hgignore

This file was deleted.

12 changes: 12 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -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)
===================

Expand Down
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
recursive-include beproud/django/notify/tests/templates *
recursive-include beproud/django/notify/templates *
recursive-include beproud/django/notify/fixtures *
include README.rst
Expand Down
7 changes: 3 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
=================
Expand Down
6 changes: 2 additions & 4 deletions beproud/django/notify/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__ = (
Expand Down Expand Up @@ -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)

Expand Down
4 changes: 0 additions & 4 deletions beproud/django/notify/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +0,0 @@
from beproud.django.notify.tests.test_basic import * #NOQA
from beproud.django.notify.tests.test_mail import * #NOQA
from beproud.django.notify.tests.test_storage import * #NOQA
from beproud.django.notify.tests.test_tasks import * #NOQA
9 changes: 7 additions & 2 deletions test_settings.py → beproud/django/notify/tests/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
# https://github.com/django/django/blob/70035fb0444ae7c01613374212ca5e3c27c9782c/django/conf/__init__.py#L188
# そのため、testではdjango.conf.global_settingsを直接利用せず、このtest用settings定数を使用する。

import os
import celery

SECRET_KEY = "SECRET"
INSTALLED_APPS = (
'django.contrib.auth',
Expand All @@ -22,7 +25,6 @@
}
}

import os
BASE_PATH = os.path.dirname(__file__)

TEMPLATES = [
Expand Down Expand Up @@ -56,5 +58,8 @@
BPNOTIFY_SETTINGS_STORAGE = 'beproud.django.notify.storage.db.DBStorage'

# The name of the class to use to run the test suite
TEST_RUNNER = 'django.test.runner.DiscoverRunner'
# TEST_RUNNER = 'django.test.runner.DiscoverRunner'

app = celery.Celery()
app.config_from_object('django.conf:settings', namespace='CELERY')
app.autodiscover_tasks(lambda: INSTALLED_APPS)
Loading

0 comments on commit ef76168

Please sign in to comment.