1

I want to restrict the version of the specific requirement package in the setup.py to like

(>1.0, <2.0) or (>3.0) 

The reason I want to do this is the dependent package is broken for 2.1 ~ 3.0, so I want to prevent user from installing these releases.

However according to the official document, it says only

>1.0, !=1.5.1, <2.0  : Any version after 1.0 and before 2.0 is compatible, except 1.5.1

According to this, it seems that inequality sign is only evaluation with "and", and not compatible with the case with mixture of "or" and "and" condition as in my case.

Does anybody know how to restrict in a way like (>1.0, <2.0) or (>3.0)?

orematasaburo
  • 1,207
  • 10
  • 20
  • I think this is essentially the same question as [pip/setuptools/packaging using version specifiers, as defined in PEP440, to define multiple possible ranges](https://stackoverflow.com/q/63499756/674039), which has not received any acceptable answer either. – wim Jan 21 '22 at 04:04

1 Answers1

-2

Have you tried something like this >1.0, !=(>2.0, <3.0) ?