admin管理员组文章数量:1414879
I have a Python package with two variations: a CPU-only, and a GPU-enabled build. I would like to distribute both versions on PyPI, where users could maybe do something like the following (it doesn't have to be this exact syntax, as long as its reasonably easy to work with for users, it's OK):
pip install mypkg-cpu
for the CPU-only build,
pip install mypkg
for the GPU-enabled build.
Users must be able to have the same import
statements in Python regardless of which version they have downloaded.
I've thought about maybe using versioning for this purpose. At least in the past, PyTorch seemed to take this approach: pip install torch==1.9.0+cpu
. However, I'm worried about a case where another package starts depending on my package, and in their requirements, they have something like mypackage>=1.23
-- would that dependency be satisfied by mypackage==1.23+cpu
?
本文标签: pythonHow to distribute multiple variations of a package on PyPIStack Overflow
版权声明:本文标题:python - How to distribute multiple variations of a package on PyPI? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745203847a2647535.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论