检查python 3支持的要求
我在pip需求文件中列出了几个具有不同依赖项集合的python项目。我已经开始考虑将代码移植到python 3中,但是我需要知道我的依赖项是否已经存在。
是否可以检查requirements.txt
文件中的哪些软件包支持python 3,哪些不支持?
示例requirements.txt
内容:
mysql-python==1.2.5
lxml==3.3.4
Fabric==1.8.0
在此列表中,仅lxml
支持python 3。
只是一个旁注。
有一个Superpowers的Python
3墙(python3wos项目),显示了流行的python软件包对python
3的支持。
据我了解,python3wos
定期解析Python Package
Index
HTML页面和检查的Programming
Language :: Python :: 3
文字来定义一个包是否支持蟒蛇3支与否。没有比在PyPI上抓取HTML更简单的方法了吗?
-
在@thefourtheye和py3readiness.org的帮助下,我已经找到了我真正需要的东西。
caniusepython3
Brett
Cannon撰写的模块:确定哪些项目阻止您移植到Python 3
该脚本接收了一组依赖项,然后找出其中的哪些阻止了您移植到Python 3。
示例(针对
requirements.txt
问题的):$ caniusepython3 -r requirements.txt Finding and checking dependencies ... You need 2 projects to transition to Python 3. Of those 2 projects, 2 have no direct dependencies blocking their transition: fabric mysql-python
我应该注意,它仍然使用与
python3wos
-Programming Language :: Python :: 3x
在包页面上查找分类器相同的方法。还有一个Web界面,您可以在其中键入依赖项或删除
requirements.txt
文件。