Menu

#145 Simplify version checks and update classifiers

None
closed-fixed
nobody
None
5
2018-11-26
2018-09-08
Hugo
No

Docutils 0.14 supports Python 2.6-2.7 and 3.3+.

This patch:

  • Removes some redundant code when sys.version_info < (2,5)
  • Simplifies some version checks against (3,2) to < (3,)
  • Adds python_requires to setup.py to help pip install the correct version of the package for a user's Python
  • Adds explicit Python 3.x Trove classifiers
  • Removes an unecessary (3,) < sys.version_info < (3,2,4) check

Tests pass locally on Python 2.7 and 3.7:

66% [hugo:/tmp/docutils-code/docutils] trunk(11)  python2 test/alltests.py && python3 test3/alltests.py
Testing Docutils 0.15b.dev with Python 2.7.15 on 2018-09-08 at 15:57:59
OS: Darwin 17.7.0 Darwin Kernel Version 17.7.0: Thu Jun 21 22:53:14 PDT 2018; root:xnu-4570.71.2~1/RELEASE_X86_64 (darwin, Darwin-17.7.0-x86_64-i386-64bit)
Working directory: /private/tmp/docutils-code/docutils/test
Docutils package: /private/tmp/docutils-code/docutils/docutils
............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
----------------------------------------------------------------------
Ran 1388 tests in 10.126s

OK
Elapsed time: 12.124 seconds
Testing Docutils 0.15b.dev with Python 3.7.0 on 2018-09-08 at 15:58:10
OS: Darwin 17.7.0 Darwin Kernel Version 17.7.0: Thu Jun 21 22:53:14 PDT 2018; root:xnu-4570.71.2~1/RELEASE_X86_64 (darwin, Darwin-17.7.0-x86_64-i386-64bit)
Working directory: /private/tmp/docutils-code/docutils/test3
Docutils package: /private/tmp/docutils-code/docutils/build/lib/docutils
...............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
----------------------------------------------------------------------
Ran 1391 tests in 8.698s

OK
Elapsed time: 10.171 seconds
1 Attachments

Discussion

  • Hugo

    Hugo - 2018-09-08

    Here's the pip installs for docutils from PyPI for August 2018:

    python_version percent download_count
    2.7 80.95% 20,550,795
    3.6 9.82% 2,494,209
    3.5 4.60% 1,166,632
    3.4 3.05% 773,980
    3.7 1.03% 261,256
    2.6 0.54% 137,323
    3.3 0.01% 2,804
    3.8 0.00% 696
    3.2 0.00% 53
    None 0.00% 20
    Total 25,387,768

    Source: pypinfo --start-date 2018-08-01 --end-date 2018-08-31 docutils pyversion

    Python 2.6 and 3.3 are EOL (since 2013-10-29 and 2017-09-29 respectively) and no longer receiving security updates (or any updates) from the core Python team.

    They're also relatively little used. Is there a schedule for dropping these EOL versions?

     
  • Günter Milde

    Günter Milde - 2018-11-21

    Thank you for the patch:

    Removes some redundant code when sys.version_info < (2,5)
    Applied and committed.
    Simplifies some version checks against (3,2) to < (3,)
    If this regards features introduced in 3.0, fine. If it regards changes in 3.3, I'd prefer the more specific check.
    Adds python_requires to setup.py to help pip install the correct version of the package for a user's Python
    Are there side-effects/warnings when using the vanilla installation method with a downloaded package?
    Adds explicit Python 3.x Trove classifiers
    Should we also remove 'Programming Language :: Python :: 3',?
    Removes an unecessary (3,) < sys.version_info < (3,2,4) check
    Applied.

    Is there a schedule for dropping these EOL versions?
    We could add a note to "future changes" in RELEASE-NOTES.txt now and drop support in 0.16.

     
  • Hugo

    Hugo - 2018-11-24
    • Adds python_requires to setup.py to help pip install the correct version of the package for a user's Python

    Are there side-effects/warnings when using the vanilla installation method with a downloaded package?

    python setup.py install will attempt an install regardless of python_requires.

    pip install -e . with older setuptools versions will ignore unknown keywords like python_requires , and attempt an installation. The addition of python_requires makes no difference in this case.

    pip install -e . with newer setuptools will check the user's Python version against the constraints. If it matches, it'll install. If not, it'll say something like PACKAGE requires Python VERSION but the running Python is VERSION.

    pip install package from PyPI is similar, except it will also check for older versions of the package until it find a package version suitable for the running Python.


    • Adds explicit Python 3.x Trove classifiers

    Should we also remove 'Programming Language :: Python :: 3',?

    No, as long as at least some Python 3.x version is supported, leave it in.

     
  • Günter Milde

    Günter Milde - 2018-11-26
    • status: open --> closed-fixed
     
  • Günter Milde

    Günter Milde - 2018-11-26

    Done (r8241).
    Thank you for the patch.

     

Log in to post a comment.