Restore compile-time support for Python 3.5
ClosedPublic

Authored by flherne on Dec 23 2016, 7:21 PM.

Details

Summary

(against the python36 branch, obviously)

Python 3.5 is default on Ubuntu 16.04 LTS and 16.10, Mint 18 and other commonly-used distros, we probably shouldn't drop it yet.

AST nodes in 3.6 seem to be a superset of those in 3.5, and no other changes (discovered so far?) affect kdev-python. Simply skipping the generating code for new AST types will allow compilation against 3.5.

Add a new SINCE directive in python36.sdef, e.g. SINCE 3.6, and make conversionGenerator.py emit #if checks for affected statements.

This can't be used with CODE, because that wasn't needed yet. (:P)

The bundled FindPython CMake module doesn't handle multiple Python versions. Instead use FindPythonInterp and FindPythonLibs from upstream CMake, which (without EXACT) will find newer versions than the one requested; the existing check ensures the version isn't too new.

Test Plan

Compiled against Python 3.5, it builds and seems to work fine.

Didn't actually try 3.6 yet, I don't have it...

Diff Detail

Repository
R53 KDevelop: Python Support
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
flherne updated this revision to Diff 9345.Dec 23 2016, 7:21 PM
flherne retitled this revision from to Restore compile-time support for Python 3.5.
flherne updated this object.
flherne edited the test plan for this revision. (Show Details)
flherne added a reviewer: brauch.
flherne set the repository for this revision to R53 KDevelop: Python Support.
Restricted Application added a subscriber: kdevelop-devel. · View Herald TranscriptDec 23 2016, 7:21 PM
brauch accepted this revision.Dec 23 2016, 7:30 PM
brauch edited edge metadata.

Oh, hmm, you're right -- we can just not create the AST nodes, then we don't even need to #ifdef the visitor code. Very nice solution.

Thanks a lot for doing this work, I think it's really useful.

This revision is now accepted and ready to land.Dec 23 2016, 7:30 PM
flherne updated this revision to Diff 9346.Dec 23 2016, 7:31 PM
flherne edited edge metadata.

Oh, and #if out the new tests...

This revision was automatically updated to reflect the committed changes.