This argument for setuptools uses the PEP440 version specifiers spec, so you can ask for:
python_requires=">=2.7,!=3.0.*,!=3.1.*"
The commas , are equivalent to logical and operator.
Note that the metadata generated is only respected by pip>=9.0.0 (Nov 2016).