-
Notifications
You must be signed in to change notification settings - Fork 2
Conversation
5a40420
to
995b8b1
Compare
@@ -1,2 +1 @@ | |||
recursive-include beproud/django/mailer/templates * | |||
README.md |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
前のPRで削除されているのでこちらも削除
mail_pre_send = Signal() | ||
mail_post_send = Signal() |
There was a problem hiding this comment.
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が廃止。
|
||
[project] | ||
name = "bpmailer" | ||
version = "1.3" |
There was a problem hiding this comment.
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に移植。
|
||
|
||
手順 | ||
-------------------- | ||
1. 次バージョンのパッケージをビルド | ||
|
||
* ``python setup.py sdist bdist_wheel`` | ||
* ``python -m build .`` |
There was a problem hiding this comment.
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
@@ -1,5 +0,0 @@ | |||
# toxを使用せず、直接 python tests.py で単体テスト実行する際に pip installするパッケージ一覧です。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
python tests.pyは実行できなくなったので削除
@@ -0,0 +1,40 @@ | |||
SECRET_KEY = "SECRET" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
もとはtests.pyに一緒に記述していたものだが、pytestで実行するために切り出した。
995b8b1
to
2235069
Compare
@@ -1,34 +1,31 @@ | |||
#:coding=utf-8: | |||
|
|||
import logging |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
テストコードなのでアプリケーションコードには影響なし。
mockをunittestのものにしたり、 DeprecationWarning: Please use assertEqual instead.
が出ていたのでごそっと置き換えたののついでにRuffでフォーマットをかけました。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ウワー差分がー(内容は流し読み
dj42: Django>=4.2,<5.0 | ||
celery52: celery>=5.2,<5.3 | ||
celery53: celery>=5.3,<5.4 | ||
commands=pytest {posargs} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
python setup.py test
は非推奨になったのでpytestに置き換え
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!!
@@ -1,34 +1,31 @@ | |||
#:coding=utf-8: | |||
|
|||
import logging |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ウワー差分がー(内容は流し読み
"Environment :: Plugins", | ||
"Topic :: Software Development :: Libraries :: Python Modules", | ||
] | ||
dependencies = ["Django>=3.2", "six", "Celery"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
お、sixがまだ残ってますね。この機に削除でもよいかと思う(余力があれば)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
six消そうかなと思ったのですが、既存プロジェクトの他のパッケージで依存があったので、強いモチベーションがなくそのままにしました()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
いろいろ勉強になった!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setup( | ||
name='bpmailer', | ||
version='1.2', | ||
description='Mailing utility for Django', | ||
long_description=read_file('README.rst'), | ||
long_description_content_type="text/x-rst", | ||
author='BeProud Inc.', | ||
author_email='project@beproud.jp', | ||
url='https://github.com/beproud/bpmailer/', | ||
python_requires='>=3.9', | ||
classifiers=[ | ||
'Development Status :: 3 - Alpha', | ||
'License :: OSI Approved :: BSD License', | ||
'Programming Language :: Python', | ||
'Programming Language :: Python :: 3', | ||
'Programming Language :: Python :: 3.9', | ||
'Framework :: Django', | ||
'Framework :: Django :: 2.2', | ||
'Intended Audience :: Developers', | ||
'Environment :: Plugins', | ||
'Topic :: Software Development :: Libraries :: Python Modules', | ||
], | ||
include_package_data=True, | ||
packages=find_packages(), | ||
namespace_packages=['beproud', 'beproud.django'], | ||
install_requires=['Django>=2.2', 'six', 'Celery'], | ||
test_suite='tests.main', | ||
zip_safe=False, | ||
keywords=['django', 'mail'] | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[memo]
いくつかの引数が pyproject.toml になかったため、気になったので調べてみました。
-
long_description
https://python-poetry.org/docs/master/pyproject/#readme
readme で指定しているので不要 -
test_suite
setup.py test is going to be deprecated pytest-dev/pytest#5534
python setup.py test
は非推奨なので不要 -
zip_safe
https://setuptools.pypa.io/en/latest/deprecated/zip_safe.html#understanding-the-zip-safe-flag
この引数の指定は不要 -
namespace_packages
Add deprecation messages fornamespace_packages
pypa/setuptools#3262
非推奨なので不要 -
include_package_data
https://setuptools.pypa.io/en/latest/userguide/datafiles.html#data-files-support
[tool.setuptools.packages.find]
/MANIFEST.in
でパッケージに含めるファイルを指定しているので不要
@@ -1,19 +1,41 @@ | |||
# Requires tox > 1.8 | |||
|
|||
[tox] | |||
envlist = py39-django22 | |||
envlist = py{39,310,311}-dj{32,42}-celery{52,53},py312-dj42-celery53 | |||
skipsdist = True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[memo]
テスト結果を出力しないように指定しているらしい。
https://tox.wiki/en/latest/config.html#skipsdist
https://dev.classmethod.jp/articles/tox-without-dist/
具体的な変更内容
python -m build && twine check時のログ