1

I was researching a solution for AVRO-2240 and thought that I should be able to use environment markers as a better way to indicate that a package is designed for Python 3, but not for Python 2.

Environment markers are generally demonstrated with specific dependencies, as in

install_requires = ['argparse;python_version<"2.7"']

However, this refers to a dependency argparse, which doesn't always need to be installed. In this case I need to clarify that the package itself can't be installed in a python 2 environment. I tried

install_requires = ['python_version>="3"']

and ran ./setup.py develop in python2 and python3 virtualenvs, respectively. That installed python-version 0.0.2 rather than giving any indication about environment compatibility.

I also added a trove classifier:

'Programming Language :: Python :: 3 :: Only'

but that didn't make a difference -- I think those are only used for classifying packages on pypi itself.

Is there any way I can make python packaging tools aware that this code does not work with python<3 in a way that's useful to users and developers without making setup.py itself python 2 incompatible?

kojiro
  • 74,557
  • 19
  • 143
  • 201

0 Answers0