请查看此问题:
DeprecationWarning in Python 3.6 and 3.7
File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/PIL/TiffImagePlugin.py", line 57, in <module>
import distutils.version
File "/home/travis/virtualenv/python3.6.3/lib/python3.6/distutils/__init__.py", line 4, in <module>
import imp
File "/home/travis/virtualenv/python3.6.3/lib/python3.6/imp.py", line 33, in <module>
DeprecationWarning, stacklevel=2)
DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
The command "python -W error::DeprecationWarning manage.py test" exited with 1.
[在此发表评论的人说,这是virtualenv
的问题,已在virtualenv
16.3.0中修复(请参见评论)。
我尝试在测试中升级到最新的virtualenv
(virtualenv==16.4.3
),但是在启用了弃用警告的情况下,在Python 3.6和3.7中,使用DeprecationWarning
的测试仍然失败:
python -W error::DeprecationWarning manage.py test
with Pillow==5.4.1
python -W error::DeprecationWarning manage.py test
with Pillow==6.0.0
怎么了?
您可以在Speedy Net的相关分支中查看代码。
例如,分支uri_run_tests_with_deprecation_warnings_2019-04-02_a
。
Update:我了解问题是在uri_run_tests_with_deprecation_warnings_2019-04-02_a
升级之前已激活虚拟环境。因此,激活的版本与升级后的版本不同。是否可以在具有最新virtualenv
版本的Travis上运行测试,还是我必须等到Travis对其进行升级?
我为setuptools创建了一个新问题:virtualenv