我们有一个Python2产品发布为RPM。RPM只包含pyo/pyc文件,运行的脚本引用某些pyo文件来运行产品。我们使用setuptools打包这些RPM:
python setup.py bdist_rpm --release=... --requires=... --bdist-base=...
我们现在将产品移植到python3.6,发现pyc文件no longer reside in the same location作为py文件。它们位于py文件文件夹下的\uuu pycache\uuuu文件夹中,而且,如果相应的py文件不存在,它们将无法工作。如果pyc文件正在替换py文件,并且不在pycache中,则仍然支持遗留行为。你知道吗
documentation显示python compileall可以接受a-b标志:
Write the byte-code files to their legacy locations and names, which may overwrite byte-code files created by another version of Python. The default is to write files to their PEP 3147 locations and names, which allows byte-code files from multiple versions of Python to coexist.
但是,由于我们使用setuptools,所以我们不控制编译命令行。你知道吗
问题:
目前没有回答
相关问题 更多 >
编程相关推荐