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

support Python3.10 over & Django4.2 #21

Merged
merged 1 commit into from Feb 7, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/tests.yml
Expand Up @@ -13,16 +13,16 @@ jobs:
# 並列して実行する各ジョブのPythonバージョン
strategy:
matrix:
python-version: ['3.9']
django-version: ['2.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
23 changes: 0 additions & 23 deletions .hgignore

This file was deleted.

1 change: 0 additions & 1 deletion MANIFEST.in
@@ -1,2 +1 @@
recursive-include beproud/django/mailer/templates *
README.md
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

前のPRで削除されているのでこちらも削除

6 changes: 3 additions & 3 deletions README.rst
Expand Up @@ -5,9 +5,9 @@
Requirements
============

* Python (3.9)
* Celery (5.x)
* Django (2.2)
* Python (3.9, 3.10, 3.11, 3.12)
* Celery (5.2, 5.3)
* Django (3.2, 4.2)

Links
=================
Expand Down
4 changes: 2 additions & 2 deletions beproud/django/mailer/signals.py
@@ -1,5 +1,5 @@
#:coding=utf-8:
from django.dispatch import Signal

mail_pre_send = Signal(providing_args=["message"])
mail_post_send = Signal(providing_args=["message"])
mail_pre_send = Signal()
mail_post_send = Signal()
Comment on lines +4 to +5
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4.0でSignalのコンストラクタの引数に、providing_argsが廃止。

37 changes: 37 additions & 0 deletions pyproject.toml
@@ -0,0 +1,37 @@
[build-system]
requires = ["setuptools>=61.0.0", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "bpmailer"
version = "1.3"
Copy link
Contributor Author

@kashewnuts kashewnuts Feb 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

python setup.pyで実行するコマンドは非推奨になりつつあるので、pyproject.tomlに移植。

authors = [
{ name="BeProud Inc.", email="project@beproud.jp" },
]
description = "Mailing utility for Django"
readme = "README.rst"
requires-python = ">=3.9"
keywords=["django", "mail"]
classifiers = [
"Development Status :: 3 - Alpha",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Framework :: Django",
"Framework :: Django :: 3.2",
"Framework :: Django :: 4.2",
"Intended Audience :: Developers",
"Environment :: Plugins",
"Topic :: Software Development :: Libraries :: Python Modules",
]
dependencies = ["Django>=3.2", "six", "Celery"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

お、sixがまだ残ってますね。この機に削除でもよいかと思う(余力があれば)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

six消そうかなと思ったのですが、既存プロジェクトの他のパッケージで依存があったので、強いモチベーションがなくそのままにしました()


[project.urls]
Homepage = "https://github.com/beproud/bpmailer/"

[tool.setuptools.packages.find]
where = ["."]
4 changes: 2 additions & 2 deletions release_checklist.rst
Expand Up @@ -7,14 +7,14 @@
* GitHub, PyPI, TestPyPIのアカウントにbpmailerの編集権限を設定
* パッケージのビルドに使用するパッケージをインストール

* ``pip install wheel twine``
* ``pip install wheel twine build``


手順
--------------------
1. 次バージョンのパッケージをビルド

* ``python setup.py sdist bdist_wheel``
* ``python -m build .``
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

現在はbuildを使うようになっているので記述を更新
refs: Python のプロジェクトをパッケージングする - Python Packaging User Guide


2. twineのコマンドを実行して、エラーが出ないことを確認

Expand Down
5 changes: 0 additions & 5 deletions requirements-test.txt

This file was deleted.

71 changes: 0 additions & 71 deletions setup.py

This file was deleted.

73 changes: 0 additions & 73 deletions tests.py

This file was deleted.

Empty file added tests/__init__.py
Empty file.
40 changes: 40 additions & 0 deletions tests/settings.py
@@ -0,0 +1,40 @@
SECRET_KEY = "SECRET"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

もとはtests.pyに一緒に記述していたものだが、pytestで実行するために切り出した。

INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'beproud.django.mailer',
)
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
}
}

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
USE_TZ = False

# For Celery Tests
CELERY_TASK_ALWAYS_EAGER = True
CELERY_TASK_EAGER_PROPAGATES = True
BROKER_BACKEND = 'memory'

import celery

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