![](/img/trans.png)
[英]How can I edit a GitHub repository (for a Python package) locally and run the package with my changes?
[英]can i run futurize --stage2 changes without having a dependency on future package
我想以2/3兼容性支持我的python 2.7代碼。 我選擇了Futurize進行更改。 在運行時-使用Futurize進行stage2更改可以正常工作,並且我的所有測試都運行良好。 問題在於,與要在其上進行更改的存儲庫功能一起使用的工具需要將來安裝(pip install future)。 有沒有一種方法可以消除工具方面的依賴性,從而不需要我以后安裝。
如果上述方法不起作用,我的另一選擇是使用Modernize進行更改
--stage2引入了內置函數,如果將來卸載,它將帶來問題
from __future__ import print_function
+ from __future__ import unicode_literals
+ from builtins import str
from openshift import *
預期結果:無需將來在工具端安裝任何使用futurize的方法
我無法消除對未來的依賴,所以我使用了Modernize,其更改不需要上述任何依賴
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.