python - How to distribute multiple variations of a package on PyPI? - Stack Overflow

I have a Python package with two variations: a CPU-only, and a GPU-enabled build. I would like to distr

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?

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745203847a4616488.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信