vlasovskikh / funcparserlib

Recursive descent parsing library for Python based on functional combinators
https://funcparserlib.pirx.ru
MIT License
338 stars 38 forks source link

Drop support for EOL Pythons; Add support for modern Pythons #57

Closed jdufresne closed 4 years ago

jdufresne commented 5 years ago

Python 2.6 and 3.3 are end of life. They are no longer receiving bug fixes, including for security issues. Python 2.6 went EOL on 2013-10-29 and on 2017-09-29. For additional details on support Python versions, see:

Supported: https://devguide.python.org/#status-of-python-branches EOL: https://devguide.python.org/devcycle/#end-of-life-branches

Removing support for EOL Pythons will reduce testing and maintenance resources while allowing the library to move towards a modern Python 3 style.

Using pypinfo, we can show the PyPI download statistics, showing very low numbers for EOL Pythons.

python_version percent download_count
2.7 75.89% 40,163
3.6 14.71% 7,784
3.5 5.37% 2,843
3.7 2.77% 1,464
3.4 1.06% 561
2.6 0.20% 104
3.8 0.00% 1
Total 52,920

This allows the library to stop using use_2to3 in setuptools. Use of use_2to3 is not recommended. See:

https://setuptools.readthedocs.io/en/latest/python3.html

Setuptools provides a facility to invoke 2to3 on the code as a part of the build process, by setting the keyword parameter use_2to3 to True, but the Setuptools strongly recommends instead developing a unified codebase using six, future, or another compatibility library.

Code is now compatible with both Python2 & Python3 with some small help from six as a compatibility library for tests.

Now that use_2to3 is not installed, can move tests outside of the installation. Users of the library no longer need to install tests to site-packages. The tests are still included in source distributions.

This results in the following changes:

hugovk commented 4 years ago

2.7 and 3.4 are also EOL now.

And 3.8 has since been released.

vlasovskikh commented 4 years ago

@hugovk Yes, you're right. however I want to try supporting 2.7 as a legacy Python 2 version for a while, until the actual library usage for 2.7 drops to 1-2%.

vlasovskikh commented 4 years ago

@jdufresne Thanks a lot for your analysis and your changes in this PR! It's really helpful. It took me almost 2 years to reply :( I started reviewing open PRs since this weekend.

hugovk commented 4 years ago

@hugovk Yes, you're right. however I want to try supporting 2.7 as a legacy Python 2 version for a while, until the actual library usage for 2.7 drops to 1-2%.

Okay! To help track progress, here's the pip installs for funcparserlib from PyPI for May 2020:

category percent downloads
3.6 27.92% 15,854
2.7 23.57% 13,382
3.7 21.59% 12,259
3.8 19.63% 11,146
3.5 6.48% 3,680
null 0.74% 419
3.4 0.05% 31
2.6 0.02% 11
3.9 0.00% 2
Total 56,784

Source: pip install -U pypistats && pypistats python_minor funcparserlib --last-month

So since Oct 2018, 2.7 has gone down from 76% to 24%!

vlasovskikh commented 4 years ago

@hugovk Thank you, this is very helpful! Thanks for your library and thanks @crflynn for pypistats.org!

So for now I'm going to support Python 2.7, 3.5, 3.6, 3.7, 3.8.

vlasovskikh commented 4 years ago

@jdufresne Thank you! I've rebased your PR as 84f1d35a84f73dd61817f1a32421833118174c28 and added Python 3.8 support with tox tests in 6ff24a53bbe6871a8d01c16858f741e2b87d64ca.