
Is there a way to specify a minimum Python version that's required by a distutils package? E.g., if I make a package, and I know it requires Python 2.1, I'd like it to check the version of Python on the system where it's being installed, to make sure that it's at least 2.1.
-Edward

From: "Edward D. Loper" edloper@gradient.cis.upenn.edu
Is there a way to specify a minimum Python version that's required by a distutils package? E.g., if I make a package, and I know it requires Python 2.1, I'd like it to check the version of Python on the system where it's being installed, to make sure that it's at least 2.1.
Only in the setup script:
import sys if sys.hexversion < 0x02010100: raise RuntimeError, "Python 2.1.1 or higher required"
setup(...)
but not in the bdist packages.
Thomas

Thomas Heller wrote:
From: "Edward D. Loper" edloper@gradient.cis.upenn.edu
Is there a way to specify a minimum Python version that's required by a distutils package? E.g., if I make a package, and I know it requires Python 2.1, I'd like it to check the version of Python on the system where it's being installed, to make sure that it's at least 2.1.
Only in the setup script:
import sys if sys.hexversion < 0x02010100: raise RuntimeError, "Python 2.1.1 or higher required"
setup(...)
Right.
but not in the bdist packages.
The Windows installer is bound to a specific Python version, so it won't even install to a different version. The rpms are different though: they don't check for the Python version and just unzip to the version directory which was specified at RPM contruction time.

From: "M.-A. Lemburg" mal@lemburg.com
Thomas Heller wrote:
From: "Edward D. Loper" edloper@gradient.cis.upenn.edu
Is there a way to specify a minimum Python version that's required by a distutils package? E.g., if I make a package, and I know it requires Python 2.1, I'd like it to check the version of Python on the system where it's being installed, to make sure that it's at least 2.1.
Only in the setup script:
import sys if sys.hexversion < 0x02010100: raise RuntimeError, "Python 2.1.1 or higher required"
setup(...)
Right.
but not in the bdist packages.
The Windows installer is bound to a specific Python version, so it won't even install to a different version.
Only if it contains compiled extensions (impure distribution)! You can, however, specify a required Python version at build time with the --target-version command line flag, but there is _no_ --minimum-target-version flag.
Thomas
participants (3)
-
Edward D. Loper
-
M.-A. Lemburg
-
Thomas Heller