Python 2.7 will retire in...

Posted on
Sat Jan 26, 2019 7:10 am
autolog offline
Posts: 3988
Joined: Sep 10, 2013
Location: West Sussex, UK [GMT aka UTC]

Python 2.7 will retire in...

See here: Python 2.7 will retire in...

I see that Python 2.7 will no longer be supported beyond the end of this year (2019). :(

Whilst I understand (I think) that Indigo will only be supported on the python version shipped with the official version of macOS, I am wondering if plugin developers should be thinking about the necessary changes to their plugins to support Python 3 and what Matt and Jay's view is on this?

I say this if only because Apple have a habit of suddenly springing new developer requirements on us at each new macOS release. :wink:

Posted on
Sat Jan 26, 2019 11:27 am
jay (support) offline
Site Admin
User avatar
Posts: 18220
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Python 2.7 will retire in...

We've been encouraging developers towards Python 3 compatibility (using the logging module, using the format() method to format strings, new print() syntax, new except syntax, etc).

We're somewhat caught between a rock and a hard spot: Python 2.7 is the only Python that ships with macOS, so unless we want to bundle Python 3 (which is a HUGE undertaking), we are stuck with that constraint. But, I would also encourage everyone to not worry overly about it - first, Python security upgrades to 2.7 have been few and far between over the past couple of years (and Apple is even slower to adopt them), so just because the Python community is ending updates/support doesn't mean that it will magically stop working. It can't be overstated how much python 2 stuff is still out there running. Second, while Apple does like to spring stuff on developers, I don't see them removing Python out of hand, particularly given how behind they tend to be in terms of versions shipping with macOS.

I would just recommend that developers get somewhat comfortable with the required changes that Python will/may bring. There are articles out on the net comparing things that change from 2 to 3 (like this one), so familiarizing yourself with those is not a bad idea. That's not to say look at new features to Python 3, only the things in Python 2 that break Python 3. When we do make the switch, we'll try to ensure that all the base classes absorb as many of those changes as possible so that the things that might effect you are mitigated.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Sat Jan 26, 2019 11:40 am
autolog offline
Posts: 3988
Joined: Sep 10, 2013
Location: West Sussex, UK [GMT aka UTC]

Re: Python 2.7 will retire in...

OK - Thanks for the guidance. :)

Posted on
Sat Jan 26, 2019 10:17 pm
kw123 offline
User avatar
Posts: 8363
Joined: May 12, 2013
Location: Dallas, TX

Re: Python 2.7 will retire in...

... that will keep everyone busy for some months..
from my perspective:

-print is not a problem.. not used (only on raspberry)
-format.. need to convert everything , several thousand lines
-3/1 =1.5 is a major problem
-round(2.5) = 2; round(3.5) = 4 is a medium problem
- except type, err; ==> expect type as err: > thousand lines, either 2 or 3 syntax
==> and all the unicode utf8 stuff will be a real "challenge" don't know how to make this run under 2 and 3

Karl

Posted on
Sun Jan 27, 2019 7:14 am
DaveL17 offline
User avatar
Posts: 6753
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Python 2.7 will retire in...

kw123 wrote:
==> and all the unicode utf8 stuff will be a real "challenge" don't know how to make this run under 2 and 3

Karl

I think it's a bit conditional.

I start my plugins with this shebang:
Code: Select all
#!/usr/bin/env python
# -*- coding: utf-8 -*-

So then, I believe that the difference is:
Code: Select all
# if Python 2.7
s = u"Unicod\u0394é"

# if Python 3
s = "Unicod\u0394é"

print(u"{0}".format(s))

Beyond that, I think it's a matter of writing a small function to format strings you want based on the Python version. I haven't done the research on the most straightforward way to handle this, but there may be an easy way using six. I think we're all going to want to be familiar with six.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest