Showing posts with label kdev-python. Show all posts
Showing posts with label kdev-python. Show all posts

Monday, March 17, 2014

kdevelop-python for Python 3: first stable version (1.6.0) released!

Yesterday, Python 3.4 was finally released, so I'm now happy to announce the first stable release of kdevelop-python which supports Python 3! See below for the tarballs.
As in the Python 2 series, PyQt continues to be one of the best supported frameworks.
Obsolete,  please use 1.6.1-py3 (see below) -- 1.6.0 didn't build on some systems kdev-python version 1.6.0-py3
http://download.kde.org/stable/kdevelop/kdev-python/1.6.0/src/kdev-python-v1.6.0-py3.tar.xz.mirrorlist
SHA256:974178fa00a34c5e2a4d9f6408c7fcbf92e7933182dd59216a11c1452238ceb7

kdev-python version 1.6.1-py3
http://download.kde.org/stable/kdevelop/kdev-python/1.6.1/src/kdev-python-v1.6.1-py3.tar.xz.mirrorlist
SHA256: 26b1fa25e8f24f1e0b801ece02b283a750e77543e6df1e571dd52b36778859a5


The kdev-python 1.6-py3 series is compatible with KDevelop 4.6 (kdevplatform 1.6) and is suitable for working with Python 3.x source code.
If you're only interested in using (as opposed to packaging or developing) kdev-python, you should consider installing kdev-python from your distribution's package manager instead of downloading the source code. 
The python 3 and python 2 versions cannot be installed at the same time currently!
There's not that much more to say than what was already said in the beta announcement, so I will just post some screenshots of what continues to work in the Python 3 version:
Code completion is powerful as ever and tries very hard to only make suggestions which are useful in the current context.
Code tooltips are still there, too.
As always, please report any bugs you might find to the bug tracker. Happy hacking!

Tuesday, March 4, 2014

kdevelop-python for python 3: beta release

Good news: Python 3.4 is about to be released, and with it kdevelop-python's first version to support Python 3. Until that happens in a few days, here's a beta:
kdev-python version 1.5.80-py3
http://download.kde.org/unstable/kdevelop/kdev-python/1.5.80/src/kdev-python-1.5.80-py3.tar.xz.mirrorlist
SHA256:99ca1ce97e2a7e553051be7505c17a921ab1aaf318999826ea285f771bcc538a

The kdev-python 1.6-py3 series is compatible with KDevelop 4.6 (kdevplatform 1.6) and is suitable for working with Python 3.x source code.
If you're only interested in using (as opposed to packaging or developing) kdev-python, you should consider installing kdev-python from your distribution's package manager instead of downloading the source code.
There are a few things which need to be announced about this, so read on!

Embedded Python fork

First and foremost, this abomination is finally gone in the -py3 series. Python 3.4 merged a patch which is required by kdev-python, and now we can use the system's python installation. This will especially make kdev-python comply with all distribution's requirements for packaging software, which means it will hopefully soon be available in all major distribution's package repositories.
This also means that kdev-python now depends on Python =3.4.

Python 2 compatibility

The py3 series is not compatible with Python 2, and currently you can not install kdev-python and kdev-python3 side-by-side. I will try to address this restriction in the future and I will also publish a script to install the two versions into separate environments, but for now that's what is like. Especially, for packagers, this means that kdev-python must conflict with kdev-python3. The problem cannot be solved by renaming all the files, it also requires new UI and glue code to be written to select the correct language version, which I only have done partially as of today.

Branch names in kdev-python.git

I also used this opportunity to reorganize the branches in kdev-python.git a bit:
  • python3 is now python3-legacy (do not use)
  • python3-nofork is now python3; this branch is the most recent (unstable) version of the python3 version of the plugin, and compiles against kdevplatform master
  • there's a 1.6-py3 branch which is like 1.6 but for python 3.
If you had any of the renamed branches checked out, you might need to do git reset --hard origin/branchname. In the near future, master will also be renamed to python2 and python3 will be renamed to master (but not yet).

Feature comparison of kdev-python3 and kdev-python2

Generally, the Python 3 version has all the features from Python 2 plus a few more and some bug fixes. Not all new Python 3 features are understood yet (the syntax is supported, but the semantics isn't, e.g. nonlocal does nothing), though. What is there however is support for function annotations:
If the expressions in a function annotation represent a type (i.e. not an instance or something different) they are used to adjust the function's return and argument types.
I really hope this feature gets used for type hints, so this is a first step to encourage you to use it for that. ;)
Not all is awesome just yet, though: Although I'm not aware of any major issues, there will be regressions (things which were working in Python 2 but are now broken). There are always regressions, even with the ~90% test coverage kdev-python has. That's the purpose of this beta: go forth and test, and report all the bugs to the tracker so they can be slain!

Sunday, January 26, 2014

KDevelop / Kate sprint in Barcelona in January 2014

Last week I have been in Barcelona at the KDevelop / Kate sprint with all the other nice people working on those projects. As always, it was very cool to meet everyone again and spend a week together improving software. A big thanks to the organizers and sponsors, too!

Since most of the time I work on a fairly encapuslated subsystem (Python support for KDevelop) and only a smaller part of my contributions goes towards the KDevelop / Kate core repositories, I don't  have any world-changing news to announce -- unlike for kate and KDevelop, no Qt5 / KF5 porting is happening yet in Python support. It doesn't make much sense to start porting until all the interfaces have stabilized.

Still, quite some interesting things have piled up in the last few months, and especially during the sprint.
In the following, I want to give a quick summary of those.

Tuesday, October 29, 2013

kdev-python update: version 1.5.2 released

I'm happy to announce the availability of a second stabilization update for the 1.5 series of kdev-python, the Python language support plugin for the KDevelop development environment. See the 1.5 announcement for more information.
kdev-python version 1.5.2
http://download.kde.org/stable/kdevelop/kdev-python/1.5.2/src/kdev-python-v1.5.2.tar.xz.mirrorlist
SHA256:84ae7015623a3848b1c1ce8e8f958c32778e9ba0afafa3ea3b3dd70687e1fe40

The kdev-python 1.5 series is compatible with KDevelop 4.5 (kdevplatform 1.5) and is suitable for working with Python 2.x source code.
If you're only interested in using (as opposed to packaging or developing) kdev-python, you should consider installing kdev-python from your distribution's package manager instead of downloading the source code.
kdev-python running in KDevelop master
Changes in this release (relative to 1.5.1):
  • Fix a bug which led to the PEP8 checker running on non-python files in some cases
  • Properly support unicode docstrings (thanks to Alexandr Zamaraev)
  • Fix a crash in code completion which happened in some rare cases
  • Fix a crash which could happen when a list comprehension was used as the default value for a function parameter
This is a small update containing only the above 4 bug fixes; all users are urged to switch to the new version as soon as it becomes available in their distribution.

There will be a larger update containing various cool new features in a few weeks, so stay tuned!

Saturday, May 18, 2013

kdev-python 1.5.1 released

kdev-python provides Python language support for the KDevelop integrated development environment. For more information, please look at the 1.4 and 1.5 release announcements, and especially make sure to watch this short demonstration video!

The 1.5.1 release fixes a few issues with 1.5.0. Especially, it
  • fixes a crash bug which could happen when PEP8 checking was enabled
  • fixes capitalization in the coding line completion
  • displays the correct plugin version in the About dialog
This is a rather minor update and I recommend it to everyone running 1.5.

There's one thing I forgot to announce in the 1.5 release: PEP8 checking support (which was actually a good thing, since it was rather crashy until now ;)).
PEP8 checking suppot in kdev-python 1.5.1
It will run the PEP8 style checker whenever an open file is modified and display all errors inline (if you have inline error display enabled) and in the Problems toolview.
By default it is disabled though, since it displays a lot of errors for people who don't follow PEP8, so if you want to use it, go to Settings -- Configure KDevelop -- PEP8 style checking (the change will only apply to newly opened or modified files).

If there's any issues, please make sure to let me know on the bug tracker.

The tarball can be found here, sha256 checksum is  d9b68bd2dd9361961e264254d2acfebc9ce0ea4b47ea2689d2f01a3ed81f7c47

Friday, May 3, 2013

kdev-python 1.5 released!

Hi!

I'm happy to announce the the availability of version 1.5 of kdev-python, the Python language support plugin for the KDevelop development environment. For the official (short) announcement containing links to the tarballs, see the announcement on the KDevelop website.

Here's a short video which demonstrates some of kdev-python's (and KDevelop's) nice features:
(if your network connection allows it, you can also watch the full-resolution version -- or here's a link to the youtube version if the embedded one doesn't work)

If you prefer a written summary of features and changes, please refer to the kdev-python 1.4 announcement and to the what's new in kdev-python 1.5 post.

I probably have written it often enough, but I'll repeat it once more:  Python 3 support in kdev-python will be released together with Python 3.4.

Another note, if you're using master, you have to clear your build directory (this includes running make clean in python-src/) to make it build again due to changes in the build system. If you didn't do any changes yourself, you can also run "cd kdev-python; git clean -f". Be aware that this will delete all untracked files in the kdev-python directory.

Thursday, April 25, 2013

kdev-python 1.5 rc1 -- please test!

Hi!

Five months have passed since the release of kdev-python 1.4.1, and it's about time for the next release! The 1.5 release will contain various new features and bug fixes, and also will work with KDevelop 4.5, which is to be released soon.

One of the new features in kdev-python 1.5: initializing properties in class constructors via code completion

Notable Bugs fixed

The following issues were fixed, among others:
  • 312275 don't add brackets if importing functions
  • 318802 fix quadruple-quotes from causing completion to malfunction
  • 317998 issue with function definition ranges causing completion to malfunction
  • 317808 correct inheritance completion with member access
  • 309817 correctly build uses for declarations in some corner cases
  • 309469 include documentation files for PyKDE and the rest of PyQt
  • 308986 fix a rare crash with some function definitions
  • 1d34b03 fix an infinite loop in the debugger plugin
  • 031badc don't reparse files on session restart if not necessary
The numbers are the bug / commit IDs of the change.

Notable new Features

The following new features are worth mentioning:
  • 333cf91 sort completion items based on name similarity
  • 6dc24ad class attribute initialization completion
  • cd03cee PEP8 error checking. Enable it in "configure kdevelop" if you want to use it.
  • b3ba512 support adding watches in the debugger plugin
Name-aware variable sorting: Although "the_bar" comes first alphabetically, "the_foo" is sorted first because its name matches the left side of the expression. You can still get an alphabetical list by invoking full completion.

Features that didn't make it into 1.5 yet

Two things that I wanted in 1.5 but which are not there are Python 3 support, and GHNS support. The latter is just not ready yet (might be in 1.5.1 or 1.5.2, but probably 1.6), the former can only be released in Q1 2014, as explained here.

Get it

kdev-python 1.5 is to be used with kdevplatform 1.5, and only 1.5 (so, kdevplatform with version numbers >= 1.4.60 and < 1.5.40). It's not going to work with kdevplatform master, or kdevplatform 1.4.
Please test this RC thoroughly and report any issues you find to the bugtracker, so the final 1.5 release can be as nice as possible! Get the tarball from download.kde.org. The sha256sum of the tarball is
441f675baddbfb9832a49458cc3c9a17daac4db55e7312c7a85d184bc0f4c776
Have fun with it! (not with the checksum, with the program I meant... you know)

Sunday, March 24, 2013

Various news in kdevelop, kdev-python, kdev-qmljs

Before everything else, I want to send a big "thank you" to our hard-working sysadmins who spent so much time and effort recently on fixing the git servers! It's working nicely again.

Other than that, there's various news in kdevelop-land: kdev-python now has a branch which builds against upstream python 3.4 (which is not released yet), there's a few fancy new features in kdev-qmljs (QML / javascript language support for KDevelop), and KDevelop has a new splash screen.

Saturday, March 16, 2013

kdev-python: GHNS support for documentation data

Finally, after a few days of difficult work, it's here: the prototype for kdev-python's new GHNS support for documentation data!
kdev-python now has its own settings module providing GHNS support

Thursday, March 14, 2013

GetHotNewStuff (GHNS) support with a custom server and OCS rant

For up- and downloading documentation files in kdev-python, I wanted to implement support for the KDE GHNS dialog (you know, this thing). In addition to a good GUI dialog which makes it easy for people to generate raw versions of docfiles and edit them a bit, this could be quite effective in supporting binary python modules correctly in the IDE. Sounds easy enough to do, right? The widgets are there... so just use them. It's not quite as easy tough...

Sunday, November 25, 2012

kdev-python 1.4 stable released!

I'm happy to announce the release of the first stable version of kdev-python, version 1.4! As this is the first stable release, this post is supposed to be an overview about what kdev-python actually does.

KDevelop with kdev-python 1.4
First of all, kdev-python is a plugin for KDevelop. Its purpose is to make development of python applications more convenient. The main focus of the program is static analysis of source code, and providing features which use the information gathered, such as
  • Semantic syntax highlighting (not the regex-stuff kate does, but real highlighting, showing your defined functions colorized etc.)
  • Intelligent code completion, depending on where the cursor is and what variables exist etc.
  • Navigation features, such as Jump to Declaration, searching for functions/classes, class browser, ...
  • and many more
There's also a few features other than static code analysis, such as debugger integration, but the former is clearly the main focus of the project. kdev-python itself is written in C++.

Friday, November 9, 2012

kdev-python beta 2 released!

I'm happy to announce the immediate availability of the second beta version of kdev-python, the python language plugin for KDevelop!
You can download the sources from kde.org; those can be compiled against KDevelop 4.4 (which is the current stable version).

Changes over the first beta release include:
  • Two crash bugs fixed
  • Fix a bug in parse priority things (it did sometimes cause documents not to be reparsed after a dependency was changed, which led to imports not being handled correctly)
  • Now full support for PyKDE4 and PyQt4!
Please try to make this version crash as hard as you can -- if no further grave issues are found, then the first stable version can be released soon!

Another note about the state of python 3 support: I'll probably merge the python 3 branch into master soon. All subsequent releases of master will support python 3 *only*. There will be a python 2 version of the plugin, which will be updated to work with new versions of KDevelop for quite a while (I'd guess at least two years from now), but I will not spend considerable time to backport features to that branch if they're not easily portable (I just don't have the time, sorry). I think my time is spent better on integrating the features new in python 3 and on polishing the new version instead of supporting two versions at once.
I also don't think it will be possible to have both the python 3 and the python 2 version installed at once, since that will require UI and logic for determining which version to use for what. I don't really want to write that, knowing that it will become more obsolete every day. If you really need it, you can still just install the two versions in two directories and start two instances of kdevelop (one for python 2 and one for python 3) with the two different install paths in $KDEDIRS.

Sunday, October 28, 2012

Vienna kdev/kate sprint: kdevelop settings dialog and changes to kdev-python

In an effort to improve the overall quality of KDevelop's user interface, Aleix and I polished the settings dialog of KDevelop. Since the Kate guys challenged us by showcasing their "awesome" gimp skills, I feel like I have to do that too:
Comparison between the old and the new configuration dialog in KDevelop
 There wasn't really any changes to functionality, it's just supposed to look better and be more understandable.

There's also news in kdev-python: The Python 3 version is progressing somewhat quickly, and it might be worth trying it out already! If you want to do that, just checkout the python3 branch, you can use it with kdevelop/kdevplatform master (not 1.4!).

There's two pretty significant (altough mostly internal) changes:
  1. The KDevelop hints (like "this function returns a type equivalent to the type of its first parameter") are now stored in comments instead of decorators. This should make it possible to use them in custom projects with less hassle. See the builtindocumentation.py file for examples of what the new syntax looks like, and feel free to suggest new such hints!
  2. Python 3 has nice features for annotating functions, you can do something like def myfun(arg: int) -> int: ...
    This is now supported by kdev-python, the annotations will be parsed and added to the duchain. However, this will only happen if your annotation expressions return a type: If you annotate your arguments with e.g. strings explaining what they do, that's fine, kdev-python will ignore them.
Have fun, and, as always: if you find any bugs, report them on the tracker so I can fix them as soon as possible :)

Thursday, October 25, 2012

Vienna kdev/kate sprint: First kdev-python beta release and python3 support

This is the third day of the KDevelop / kate sprint in Vienna, and it's really fun and productive so far! There's several new things related to kdev-python which I'd like to write something about.

Thursday, April 26, 2012

Improved code completion in kdev-python and call for help

I recently rewrote most of kdev-python's code completion code, as it was a huge mess (it relied largely on regular expression matching, which just isn't powerful enough to do this properly). The result is less buggy, easier to maintain, and has unit tests (yay!). In the process, I also implemented quite a few features which I want to post a few screenshots of.

There's a second issue I want to talk about in this post: A major problem which remains for kdev-python is the documentation data, that is, the way the program gets information about external libraries, for example functions and classes in those libraries. I'd love to have some help here -- if you want to help improve kdev-python, this is a great point to start! There is no knowledge required about kdev-python's code base, or even C++ (all that is to do here can be done in python). Read more below in case you're interested.

Another note: kdev-python now has its own component on bugs.kde.org. Please report any issues you might encounter there!