1

Is it possible to restrict the availability of a python package to a certain Python runtime, e.g. Python>=2.7,<3

I feel like the solutions already posted elsewhere on here (setup.py: restrict the allowable version of the python interpreter and Enforcing python version in setup.py) aren't ideal because they perform a runtime version check in the setup.py file.

Isn't it possible that a package's metadata needs to be read on one computer, to determine the package's availability for another computer?

For instance, suppose a package repository wants to index the metadata for a collection of packages. It does so using Python 3, but for this particular package, the setup.py script throws an exception. A Python 2.7 client then connects to the index and can't find the package in question, because it failed to be indexed by the Python 3-based indexer.

1
  • 1
    I think the fact that the answers there say "do the explicit check" mean the answer is: no there is no way directly supported by setuptools. Commented Jun 9, 2016 at 20:20

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.