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条)