-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
py3.9対応+次バージョン 0.48 用の記述をsetup.pyに追加 (#14)
* py36-django22を通すための改修を反映。py 2.7とdjango1.11のテストを削除。 * celery 4.2系, celery5.1系を指定する記述を追加 * py39のテストシナリオを追加 * Django 3系の条件を追記。対応はまだ。 * wip: py39-django32でfailする * django3.2のtoxがpassするように調整 * コメントを追加 * travis-ciの設定を削除。GitHub Actionsの設定を追加。 * tox.iniにtox-gh-actionsの設定を追加 * コメントを追加。github-actionsのmatrix条件を追加。 * py3.9のテストが起動しなくなったので、matrixの条件を減らす意図で、celeryの条件を削除 * strategy.max-parallelを指定。tox.iniに[gh-actions:env]の項目を追加。matrixにceleryの条件を追加。 * max-paraallelの記述を削除。toxのオプションを削除。 * 記述が難しくなったので、test.ymlの記述をいったん簡略化。 * gh-actions関連の修正 * gh-actions関連の修正 * gh-actions関連の修正 * gh-actions設定の調整 * gh-actions設定の調整 * コメントを修正 * setup.pyの記述をtox.iniの情報に合うように変更。バージョンを0.48に変更。リンク参照先とリンク先を異なるものにしたいため、READMEをrst形式の記述に変更。 * READMEをmd形式からrst形式に変更するにあたってに影響する箇所を修正。PyPIに掲載する情報を他のbp管理パッケージに合わせて追加。 * setup.pyのinstall_requires: 'django-jsonfield>=1.0.1' は記述を省けなかったので元に戻す。記述理由のコメントを追加。 * readmeの依存パッケージの記述を修正 * コメント文を修正 * suggestionを反映 Co-authored-by: Takayuki SHIMIZUKAWA <shimizukawa@gmail.com> * メソッド名変更に伴いテストコードも調整 * mockは標準ライブラリ unittestのmockを使うように変更 * ChageLogを追加 * 変更点を追記 * manifest.inにchageLogを追加 * change logを修正しました。 mockパッケージの件は、bpnotifyパッケージ内部の話なので、Featuresに変更しました。 サポート終了の話題を、Imcompatible Changesの欄に移動しました。 Celeryのメソッド名という表現をタスク名に変更しました(さらに、メソッド名ではなく、関数名だった) Co-authored-by: Takayuki SHIMIZUKAWA <shimizukawa@gmail.com>
- Loading branch information
1 parent
1e8efd6
commit 4c7694e
Showing
13 changed files
with
243 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Tests | ||
|
||
# push と pull request イベント毎にGtihubのWorkflowを起動する | ||
on: | ||
- push | ||
- pull_request | ||
|
||
jobs: | ||
# ジョブの名称 | ||
test_with_tox: | ||
name: build (Python ${{ matrix.python-version }}, Django ${{ matrix.django-version }}) | ||
runs-on: ubuntu-latest | ||
|
||
# 並列して実行する各ジョブのPythonバージョン | ||
strategy: | ||
matrix: | ||
python-version: ['3.6', '3.9'] | ||
django-version: ['2.2', '3.2'] | ||
|
||
steps: | ||
# ソースコードをチェックアウト | ||
- uses: actions/checkout@v2 | ||
|
||
# ジョブのPython環境を設定 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
# Github Actionsからtoxを実行するために必要なパッケージをインストール | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install tox tox-gh-actions | ||
# Github Actionsからtoxを実行 | ||
- name: Test with tox | ||
run: | | ||
tox -v | ||
env: | ||
DJANGO: ${{ matrix.django-version }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
ChangeLog | ||
========= | ||
|
||
0.48 (2022-04-11) | ||
=================== | ||
|
||
Features: | ||
|
||
|
||
- Python3.9のサポートを追加しました。 | ||
- toxの実行環境を、Travis CIからGitHubに変更しました。 | ||
- READMEの書式をmarkdownからreStructuredTxtに変更しました。 | ||
- mockパッケージに関して、標準ライブラリのunitestに含まれるmockを使用するように変更しました。 | ||
|
||
Incompatible Changes: | ||
|
||
- Python2.7のサポートを終了しました。 | ||
- Django1.11のサポートを終了しました。 | ||
- Celeryのタスク名を `Notify` から `notify` に変更しました。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
recursive-include beproud/django/notify/tests/templates * | ||
recursive-include beproud/django/notify/templates * | ||
recursive-include beproud/django/notify/fixtures * | ||
include README.md | ||
include README.rst | ||
include CHANGES.rst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
.. image:: https://github.com/beproud/bpnotify/actions/workflows/tests.yml/badge.svg | ||
:target: https://github.com/beproud/bpnotify/actions | ||
:alt: GitHub Actions | ||
|
||
`bpnotify` is notification routing for Django. Application notify function with targets, notify_type, media, extra_data, then bpnotify send notify with backend (example: mail). | ||
|
||
Requirements | ||
============ | ||
|
||
* Python (3.6, 3.9) | ||
* Celery (4.2, 5.1, 5.2) | ||
* Django (2.2, 3.2) | ||
* six | ||
* django-jsonfield (1.0.1) | ||
|
||
Links | ||
================= | ||
|
||
* `release checklist <https://github.com/beproud/bpnotify/blob/master/release_checklist.rst>`_ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
リリース手順 | ||
============== | ||
|
||
事前準備 | ||
-------------- | ||
|
||
* GitHub, PyPI, TestPyPIのアカウントにbpnotifyの編集権限を設定 | ||
* パッケージのビルドに使用するパッケージをインストール | ||
|
||
* ``pip install wheel twine`` | ||
|
||
|
||
手順 | ||
-------------------- | ||
1. 次バージョンのパッケージをビルド | ||
|
||
* ``python setup.py sdist bdist_wheel`` | ||
|
||
2. twineのコマンドを実行して、エラーが出ないことを確認 | ||
|
||
* ``twine check --strict dist/*`` | ||
|
||
3. dist/に作成したパッケージをTestPyPIへアップロード | ||
|
||
* ``twine upload --repository testpypi dist/*`` | ||
|
||
4. TestPyPIで、descriptionがエラーなく表示されていることと、ビルドしたパッケージがアップロードされていることを確認 | ||
|
||
* TestPyPIへアップロードした内容に問題がある場合、修正したパッケージをTestPyPIに再度アップロード | ||
|
||
5. GitHubで次バージョンのReleaseタグを作成し、Publish Releaseを実行 | ||
|
||
* dist/に試行錯誤したパッケージが残っている場合、一度全て削除し、本番アップロード用のパッケージを再度作成 | ||
|
||
6. dist/に作成したパッケージを本番環境のPyPIにアップロード | ||
|
||
* ``twine upload dist/*`` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# Django3では、標準のdjango.conf.global_settingsの定数をオーバーライドすると例外が発生する場合がある。 | ||
# https://github.com/django/django/blob/70035fb0444ae7c01613374212ca5e3c27c9782c/django/conf/__init__.py#L188 | ||
# そのため、testではdjango.conf.global_settingsを直接利用せず、このtest用settings定数を使用する。 | ||
|
||
SECRET_KEY = "SECRET" | ||
INSTALLED_APPS = ( | ||
'django.contrib.auth', | ||
'django.contrib.contenttypes', | ||
'beproud.django.notify', | ||
) | ||
|
||
# kombu.exceptions.EncodeError: Object of type User is not JSON serializable エラーを抑止する | ||
# (参考) | ||
# https://github.com/celery/celery/issues/5922 | ||
# https://stackoverflow.com/questions/49373825/kombu-exceptions-encodeerror-user-is-not-json-serializable | ||
CELERY_TASK_SERIALIZER = "pickle" | ||
|
||
DATABASES = { | ||
'default': { | ||
'ENGINE': 'django.db.backends.sqlite3', | ||
'NAME': ':memory:', | ||
} | ||
} | ||
|
||
import os | ||
BASE_PATH = os.path.dirname(__file__) | ||
|
||
TEMPLATES = [ | ||
{ | ||
'BACKEND': 'django.template.backends.django.DjangoTemplates', | ||
'DIRS': [ | ||
os.path.join(BASE_PATH, 'beproud', 'django', 'notify', 'tests', 'templates') | ||
], | ||
}, | ||
] | ||
|
||
CELERY_TASK_ALWAYS_EAGER = True | ||
|
||
BPNOTIFY_MEDIA = { | ||
"news": { | ||
"verbose_name": "News", | ||
"default_types": ("new_user", "follow", "private_msg"), | ||
"backends": ( | ||
"beproud.django.notify.backends.model.ModelBackend", | ||
), | ||
}, | ||
"private_messages": { | ||
"verbose_name": "Private Message", | ||
"default_types": ("private_msg", "notify_type_with_length_over_thirty"), | ||
"backends": ( | ||
"beproud.django.notify.backends.model.ModelBackend", | ||
"beproud.django.notify.backends.mail.EmailBackend", | ||
), | ||
}, | ||
} | ||
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' | ||
|
Oops, something went wrong.