Kinda followup to this... :)
My project is Python 3-only and my question is basically how I tell distutils/distribute/whoever that this package is Python 3-only?
Kinda followup to this... :)
My project is Python 3-only and my question is basically how I tell distutils/distribute/whoever that this package is Python 3-only?
Not sure if there's some special setting, but this in the beginning of setup.py might help:
import sys
if sys.version_info.major < 3:
print("I'm only for 3, please upgrade")
sys.exit(1)
sys.version_info < (3,)
(I believe that's primarily to make it easier to change to (3, 1)
when you want to drop support for 3.0), but I don't think this is really confusing or less readable. –
Sarnoff .major < 3
, because that immediately assigns meaning to the number. This doesn't really matter in this instance, since it's pretty obvious anyway, though ;) –
Venous © 2022 - 2024 — McMap. All rights reserved.
pip
2.x will not see your app, or will refuse to install it, or just so that runningpython2.7 setup.py install
will give an error? For the latter, bereal's solution is perfect. – Sarnoffpip
2 differently, you can always ask for that info later; no need to learn all that now if you don't plan to use it. – Sarnoffpython setup.py register
mechanism, I think asetup_requires
dependency onpython>=3.0
is enough to makedistribute
/pip
/easy_install
refuse to install your package in 2.x, and get the information onto the web page (but also put it in thelong_description
in human-readable terms). But someone who doespython2.7 setup.py install
will see an ugly traceback from aVersionConflict
, so you'll still want the explicit version check to provide a nice message. (This is all off the top of my head; please research before relying on details.) – SarnoffProgramming Language :: Python :: 3
instead of the defaultProgramming Language :: Python
classifier. Anyway, all this is really just to preventeasy_install
,pip
, or whatever future tool comes out of thedistribute2
project from having to download your package before giving an error. – Sarnoff