-
Notifications
You must be signed in to change notification settings - Fork 263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Drop support for Python < 2.6 #195
Conversation
Here's the pip installs for gcovr from PyPI for the last month (via
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could also add python_requires
to setup.py to help pip. For example, see: https://stackoverflow.com/a/44660547/724176
Also, it would be useful to add version classifiers to setup.py (https://pypi.python.org/pypi?%3Aaction=list_classifiers).
And there's a few other bits that can be removed:
-
Lines 120 to 121 in 16c81cc
if minver <= 3: REQUIRED_MODULES.extend(['sets', '__future__']) -
Lines 84 to 85 in 16c81cc
if minver <= 3: REQUIRED_MODULES.extend(['sets', '__future__']) -
Lines 25 to 29 in 16c81cc
if sys.version_info <= (2, 3): print('ERROR: %s' % sys.exc_info()[1]) print('ERROR: this script requires Python 2.4 or greater; or at least the subprocess module.') print('If you copy subprocess.py from a newer version of Python this script will probably work') sys.exit(101)
(There's probably some old Python 3.x stuff that can go from there too, is only 3.4+ supported?)
Thank you @hugovk for these statistics – they demonstrate that this change will not hurt users. And thank you too for the suggestions re classifiers and python_requires, I'll look into those shortly. The remaining unneeded version checks are constrained to the vendored virtualenv scripts. This will be resolved by deleting the scripts completely in #190. |
As suggested by hugovk in gcovr#195. The classifiers now list all versions tested by Travis CI. This excludes 2.6. The "python_requires" setting is the minimum allowed version, and will be checked by pip during installation.
The code base needs to be compatible across a wide range of Python versions. But that can only go so far. The user guide mentions these supported versions: > CPython 2.7, 3.4, and 3.5, and PyPy 2.7 and 3.5. It is also likely that some users are stuck on 2.6, so we shouldn't intentionally break 2.6 compatibility (at least not without a good reason). But support of earlier versions has disproportianate cost and little value. This commit removes any code that is unreachable under 2.6 or later.
As suggested by hugovk in gcovr#195. The classifiers now list all versions tested by Travis CI. This excludes 2.6. The "python_requires" setting is the minimum allowed version, and will be checked by pip during installation.
af42f16
to
db9181f
Compare
As suggested by hugovk in gcovr#195. The classifiers now list all versions tested by Travis CI. This excludes 2.6. The "python_requires" setting is the minimum allowed version, and will be checked by pip during installation.
As suggested by hugovk in gcovr#195. The classifiers now list all versions tested by Travis CI. This excludes 2.6. The "python_requires" setting is the minimum allowed version, and will be checked by pip during installation.
The code base needs to be compatible across a wide range of Python versions. But that can only go so far. The user guide mentions these supported versions:
It is also likely that some users are stuck on 2.6, so we shouldn't intentionally break 2.6 compatibility (at least not without a good reason).
But support of earlier versions has disproportianate cost and little value. This PR removes any code that is unreachable under 2.6 or later.
As an additional change, the unit tests now use decorators to annotate the test classes.