-
Notifications
You must be signed in to change notification settings - Fork 2
add Python3.9 and Django 2.2 support, drop Python2.7 and Django 1.11support #13
Changes from 4 commits
1c7ce2f
d1fd47f
62b696c
804876d
fb40940
3838514
9897f35
6ce6c6b
f66940e
8fcfc5f
1b33848
ebc3d14
3ea2674
96079fb
e699981
f537538
7888314
a1ce88e
aa6ebde
733479d
e40af11
6979781
ed5c025
76d2427
fecf1ae
76b6b17
fbe6534
46d2807
848e7f6
22a2dd6
411ef07
a1a425a
6b9b31c
ba0fbfe
2063bf7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,6 @@ jobs: | |
|
||
# 並列して実行する各ジョブのPythonバージョン | ||
strategy: | ||
max-parallel: 4 | ||
matrix: | ||
python-version: ['3.6', '3.9'] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 3.6はすでにEOLです。3.7に修正して良さそう There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @kemu3007 このbpmailerを使いたいプロジェクトがまだPython3.6を使っているため、現時点ではPython3.6対応は残したい感じです。 |
||
django-version: ['2.2'] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,17 +50,21 @@ def read_file(filename): | |
url='https://github.com/beproud/bpmailer/', | ||
classifiers=[ | ||
'Development Status :: 3 - Alpha', | ||
'Environment :: Plugins', | ||
'Framework :: Django', | ||
'Intended Audience :: Developers', | ||
'License :: OSI Approved :: BSD License', | ||
'Programming Language :: Python', | ||
'Programming Language :: Python :: 3', | ||
'Programming Language :: Python :: 3.6', | ||
'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>=1.11', 'six'], | ||
install_requires=['Django>=2.2', 'six'], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. すみません、もう1個思い出しました。 Py2 drop するのであれば、 例 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 追記しました
imaxyz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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.
ASK: djangoはmatrixにしないんですか?
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.
ASKの回答
tox-gh-actionsパッケージの仕様と、bpmailerのtox.iniの記述内容から、bpmailerのworkflow/tests.pyには、djangoのmatrixを記述する必要はないと判断しました。
理由
作業の際、Workflowが実行したジョブのログを確認したところ、自動でtox.iniに記述した各djangoバージョンのバリエーションテストを実行してくれていたので、matrixには記述しませんでした。
この辺の挙動をよく理解できていなかったため、再調査しました。
再調査でわかったこと
tox-gh-actionsパッケージの仕様で、tox.ini の
gh-actions
の項目にPythonバージョンを記述すると、Github Actionのジョブから実行するtoxでは、gh-actions
に記述した各Pythonバージョンに絞った状態で実行ができる仕様があるようです。次のドキュメントの例だと、
Python3.9のジョブを実行する際には、py39環境にてtoxを実行してくれるようです。
考察
試しに、workflows/tests.ymlに次のように記述して見たところ
Github Actionsは、tox-gh-actionsのドキュメントの通り、そのジョブで指定されたPythonバージョンに関するテストのバリエーションを実行していることを確認しました。
https://github.com/beproud/bpmailer/runs/5492233415?check_suite_focus=true
備考
workflowに追加した、tox -lのコマンドは今後コードを確認する人が動作を把握するのに役立つと思ったので、一旦そのまま残しました。
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.
@imaxyz matrix化することによって順次実行ではなく並列実行になります。また Python x Django の組合せ名でテスト実行記録が残るためエラー発生時に原因が追いやすくなります。この機会にそのように構成したほうが良いとおもいますが、どうでしょうか?
具体的には以下の様になります。
現在のこのPRのテスト
別プロジェクトでの例
https://github.com/jazzband/django-redshift-backend/runs/5347475991?check_suite_focus=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.
並列化しました。
Python 2.7とDjango 1.11をdropしたため、このPRでは並列化の効果が高くありませんが、今後のPRで恩恵を受けられるので、workflowを並列化する記述に修正しました。