最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

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

programmeradmin1浏览0评论

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?

发布评论

评论列表(0)

  1. 暂无评论