Monday, March 12, 2012

IronPython 2.7.2.1

There was fairly serious regression introduced between 2.7.2 RC1 and 2.7.2 final – see issue #32400 for details. Upgrading to 2.7.2.1 is highly recommended.

On the plus side, this isn’t a dataloss bug, or anything like that, just a “break almost every program in existence” bug. Basically, the code for checking for comparison operators got broken. The motivating example is

if sys.version_info < (2, 4):
# do something

I’m sure other cases would be broken as well, so I decided to err on the side of caution and update the release as soon as possible. My apologies to everyone who already downloaded 2.7.2 and was impacted by this.

Sunday, March 11, 2012

IronPython 2.7.2 Now Available

IronPython 2.7.2 has now been released. Take a look at last week’s post about what’s new for more details. There will be more posts in the next few days taking a look at some of the new features in 2.7.2, so watch this space!

Sunday, March 4, 2012

What’s New in IronPython 2.7.2?

With IronPython 2.7.2 RC now available, the feature set for 2.7.2 is now finalized. The major features for this release are zipimport, the sqlite3 module, pyc.py improvements, and preliminary support for Android and Windows Mobile 7, some changes to the package layout, and NuGet packages.

zipimport

The zipimport module allows IronPython to import modules from a .zip file. To use it, simply add the path of the .zip file to sys.path, and it will automatically be searched.

sqlite3

The sqlite3 module provides access to sqlite3 databases. It uses the csharp-sqlite library so that the implementation is fully managed, which means that it will work from Silverlight, Android, and Windows Phone as well.

Improvements to pyc.py

The pyc.py script (in Tools\Scripts\pyc.py) is now able to generate standalone exectuables. For example, you could use it to generate a standalone version of pyc.py:
> ipy Tools\Scripts\pyc.py /target:exe /standalone /main:Tools\Scripts\pyc.py

Mobile Support

IronPython 2.7.2 includes preliminary support for Android and Windows Phone 7.5 development (iOS support is still planned, but it’s much more difficult). Android requires using Xamarin’s Mono for Android, while Windows Phone is supported natively. Both platforms are similar to Silverlight yet also very different, and Android is far more capable.

There’s currently no help in setting up the app; use the normal templates for the platform, and then embed IronPython in the app. There’s a lot more work to be done in this area, which is why these are considered preliminary. If you try to use them in production we’d love bug reports, but you still get to keep the pieces.

Packaging Changes

Both the installer and and zip package now have a Platforms directory that contains the assemblies for every platform supported by IronPython (.NET 4, .NET 3.5, Silverlight 4, Silverlight 5, Android, and Window Phone 7.5). This makes it much easier to reference the appropriate platform assemblies from your project.

NuGet

Finally, the IronPython NuGet package has been updated to 2.7.2. The main “IronPython” package only contains IronPython itself; the standard library is in “IronPython.StdLib”. The RC isn’t available through the UI (because it’s a prerelease version), so you’ll have to run “Install-Package IronPython –IncludePrerelease” from the Package Manager Console to install it. For the final release this will unnecessary.