How to specify version ranges in install_requires (setuptools, distribute)

前端 未结 4 1802
余生分开走
余生分开走 2020-12-14 05:58

I want to make a package to depend the particular version range e.g. >= 0.5.0, < 0.7.0. Is it possible in install_requires option, and if so

4条回答
  •  春和景丽
    2020-12-14 06:21

    The notation mentioned in OP's question, >= 0.5.0, < 0.7.0, already works.

    And, since many (if not most) of the libraries would already use semantic versioning, so by definition you can define your dependency as A>=1,<2, as explained here. And they even implemented an even simpler syntax for it, A~=X.Y, meaning it requires at least release X.Y, but also allows any later release with a matching MAJOR version.

提交回复
热议问题