问题
I want to create a new PyPI package, but this will have an special wheels where I will invoke it like this:
pip install misoftware[customer1]
Is this possible?
If so how can I provide patches for [customer1]
For example my main release is:
misoftware==1.1 and
misoftware[customer1]
I want
misoftware[customer1]==1.1.2
This will be 3 wheels total
回答1:
You're describing setuptools 'extras'. This allows you to specify additional dependencies, so for example
misoftwarejust installs themisoftwarepackagemisoftware[customer1]would install themisoftwarepackage, plus some extra dependencies
The downside is that the dependencies you list in your extras must be hosted as packages themselves as well on PyPI. So you'd need to create a misoftware_customer1 package, and so on.
来源:https://stackoverflow.com/questions/56998851/optional-dependencies-for-pypi-packages