IronPython 3.4.0

I just merged the first draft of IronPython 3.4 engine into pyRevit source and WIP installers. IT IS WORK IS PROGRESS SO DO NOT TEST IN PRODUCTION

Where?

The new engine is available under settings and is named IronPython 3 (340)

Alternatively you can use the pyRevit command line to attach pyRevit to installed Revits using the new engine. Assuming your clone is named main the command would be:

$> pyrevit attach main 340 --installed

Code Changes?

I have modified pyRevit’s source code to be compatible with both IronPython 2 and 3. There is a compat.py module in pyrevit library that provides the necessary globals so you can configure your codes as well

from pyrevit.compat import PY3, PY2, IRONPY340
if PY3:
  # do this
elif PY2:
  # do that

Shipped Libraries?

Libraries shipped under site-packages in pyRevit installation, are supposed to be compatible with both py2 and py3. Please test and report any errors.

You can download the WIP installers from here

5 Likes

Is this only me or link is broken :grinning:?

@Konstantin you’re right
on the repo, go to Actions, then pick the latest build from develop branch and download installers

OR

  1. using the CLI clone the develop branch
    pyrevit clone <clone_name> [--dest=<dest_path>] [--source=<repo_url>] [--branch=<branch_name>]
  2. attach it to your revit versions
    pyrevit attach nameOfYourClone 340 --installed
2 Likes

Poof sorry. I apparently fogot to put the link there. Updated to the lasted WIP build link right now.

Thanks @Jean-Marc for the answer and screenshots :smiley:

3 Likes

Thanks! That helped :slightly_smiling_face:

Hi @eirannejad, I feel a certain excitement, but I am not sure what the additional features or benefits are yet compared to CPython or IronPython 2.X :flushed:?

I tried looking at the IronPython 3.4 release notes, but this also didn’t enlighten me. Does this allow us to run pyRevit scripts using both Python 3.4 libraries and pyRevit modules?

Hi @GooseG!

Try these notes:

https://github.com/IronLanguages/ironpython3/blob/master/WhatsNewInPython30.md
https://github.com/IronLanguages/ironpython3/blob/master/WhatsNewInPython31.md
https://github.com/IronLanguages/ironpython3/blob/master/WhatsNewInPython32.md
https://github.com/IronLanguages/ironpython3/blob/master/WhatsNewInPython33.md
https://github.com/IronLanguages/ironpython3/blob/master/WhatsNewInPython34.md
https://github.com/IronLanguages/ironpython3/blob/master/WhatsNewInPython35.md
https://github.com/IronLanguages/ironpython3/blob/master/WhatsNewInPython36.md

tick marks means already implemented. e.g. for IronPython 3.4 there is already f-string feature, even it is only available since python 3.6

I am personally very excited about ipy3, and looking forward to switch to it. Testing it now. Feels like I sit in a new car :grinning:

2 Likes

from the other hand, there is no tick next to enum module, but the module is in the library, we can import it now.
then I have no idea what these tick-marks mean :sweat_smile:

mystery. gotta try one by one:
image

@GooseG IronPython has its own merits, namely:

  • Compilable to dotnet DLLs
  • True multi-threading (CPython has a global interpretter lock (GIL) that forcefully syncs threads so the multi-threading performance in IronPython is better)

CPython and IronPython, althought both python 3, implement it completely differently and they’re just different beasts.

Your existing pyRevit scripts should run nicely in the new IronPython 3 with the added benefit that you can completely forget about python 2 (python 3 has much more powerful language constructs and libraries)

Use CPython when you’d need to use any of “native” libraries built for CPython e.g. numpy, scipy etc

3 Likes

I have some wpf so I cannot use cpython
but I also want to use numpy
is it possible???

You have to use WPF purely programmatically. CPython doesn’t have WPF bindings yet

1 Like

so sad :frowning:
how about winform + numpy instead of wpf?
seems I can use winform on cpython

That’s an option as well. There is also the cross-platform Eto library that could be used programmatically.

1 Like

Hi guys!
I’ve started getting errors.
How do I report them? Just make an issue in repository? Any special name?

yep, issue in the repo, following the template.
you can prefix it IPY340 maybe?

2 Likes