[Twisted-Python] The Python 2.7 Plan

2019-12-11 Thread Wilfredo Sánchez Vega
  With Python 2.7 support dropping in a matter of weeks, I'd like to pick up 
from hawkowl's thread back in March about Python 2.7 support for Twisted.

  hawkowl had shared a plan in a Google Docs document.  That URL has since gone 
stale but here's a new one (thanks, hawkowl):

  
https://docs.google.com/document/d/1lIkg6mYVMxVhh3_U6uSJ1XjllPM92Nf8Zp7b7OZPbIw/edit


  Here's what I got from the prior conversation:


Amber Brown (hawkowl):

> I personally find that Python 2 compat adds a huge amount of overhead 
> when working on and maintaining Twisted, and think that with the current 
> maintainer availability, dropping it sooner rather than later would have 
> a beneficial effect on how much work we spend on shims/compat, 
> complexity, and our ability to ship new features, as well as onboarding 
> people who are interested in the project, but have no interest (or 
> experience!) in Python 2.7.

  As an example here, I'd like us to start adopting type hints.  I find them 
incredibly valuable as documentation and for catching lots of bugs.

  The best way to adopt them is to use inline syntax supported by Python 3.6+, 
or slightly less ideal, Python 3.5+.  It looks like pydoctor may have support 
for this soon, which makes that an increasingly interesting avenue.

  To support Python 2.7, we'd have to use either:

  - the comments-based inline syntax, which is far uglier and leaves us with an 
extra project of converting those later when we finally do drop 2.7, or

  - stub files, which are considerably less easy to manage over time

  Doing this will also afford us an opportunity to better express the API (do 
we mean to return a "mutable sequence" or a specifically a list, etc.).

  There's a longer conversation to be had about type hints, and that should be 
on a separate thread; I only talk about it here to explain why Python 2.7 is in 
the way.

> One of my rationales is that from some analysis of PyPI download 
> statistics, the vast majority of Python 2 users are using old versions 
> of Twisted, while nearly all our Python 3 users are on the latest 
> version.

  Can you share how you looked up these stats?  I don't see a way to do so with 
pypistats.


John Santos:

> I hope/expect that none of my code changes to make my source compatible 
> with both 2.7 and 3 will break when Twisted support for 2.7 goes away!  
> (It seems to me the Twisted compatibility policy would guarantee that.)

  To be clear, I would not expect this to be the case if you update Twisted to 
a version that no longer supports Python 2.7.  You would have to continue using 
a version that does support Python 2.7. You should have some runway, however, 
in which your app still works with either Py2.7 and Twisted 19 as well as Py3.8 
using Twisted 20, for example.


Glyph, in reference to a maintenance branch for Python 2.7:

> Personally, I'm not willing to commit to this.  I know from experience both 
> on Twisted and other projects that maintaining multiple release branches, 
> even one that's "maintenance only", requires at least one point-person for 
> each branch at all times (usually a "release manager").  And backporting 
> fixes inevitably gets harder and harder as the "maintenance" branch diverges 
> from top-of-tree.  If I have time to work on Twisted in my increasingly 
> scarce spare time, I want it to be on something at least plausibly 
> interesting, and manually backporting manual fixes to an unmaintained py2 
> branch that I don't even use doesn't qualify.

  I tend to agree.  I think the compromise would be that we could be willing to 
accept back-ports of certain fixes (presumably limited to security fixes?) to a 
maintenance branch, but not that we would commit to doing so for any period of 
time.

  Additionally, we've already supported Python 2.7 for the entirely supported 
lifetime of Python 2.7.

  Glyph also notes some infrastructure we use that is blocked on code fixes:

  - Trac: https://trac.edgewall.org/ticket/12130
Looks like we can leave the Trac instance running in a Twisted 19 WCGI 
server until they fix that.

  - DNS: https://twistedmatrix.com/trac/ticket/9496
I'd suggest we do the same as with Trac until this is fixed, but Glyph 
disagrees.


  Back to hawkowl's document:

  - Part 1: I think we should drop the Py2.7 maintenance branch piece per 
Glyph's comment above.

  - Part 2: Re-introduced modules should go into separate repositories, not 
back into Twisted proper.

  As to the timeline, Option 1 would be to cut a 2.7 release in a couple of 
weeks.  I don't know that we need to do this in January, but I would suggest 
that our next release is the final release for 2.7.  This would require a fix 
to the DNS issue #9496.

-wsv

___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
https://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] The Python 2.7 Plan

2019-12-11 Thread Jean-Paul Calderone
On Wed, Dec 11, 2019 at 4:06 PM Wilfredo Sánchez Vega 
wrote:

>   With Python 2.7 support dropping in a matter of weeks, I'd like to pick
> up from hawkowl's thread back in March about Python 2.7 support for Twisted.
>

Despite the widely circulated January 1 2020 date, it seems that python-dev
nevertheless plans to make a Python 2.7 release in April 2020 -
https://www.python.org/dev/peps/pep-0373/

This is not to say the questions here don't need answering or that there
isn't some urgency at this point, but it seems like the January 1 date is
essentially an arbitrary deadline without a clear connection to the support
status of CPython 2.7.

Or does anyone know a different way to reconcile these apparently
conflicting dates?

Jean-Paul
___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
https://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] The Python 2.7 Plan

2019-12-11 Thread Wilfredo Sánchez Vega
  I don't object to the final release being in April instead of January, though 
I'm not sure that the additional release really means we need to do that.  But 
FWIW I'm in favor of Option 3 / calling 19.4 the final release.  :-)

  My sense is that there was consensus on hawkowl's proposal except for, I 
think:

1- Should we drop the idea of a 2.7 maintenance branch?
2- It seems we need to fix the bug in twisted.names first.
3- Choosing a final 2.7 release date.

-wsv


> On Dec 11, 2019, at 1:16 PM, Jean-Paul Calderone  
> wrote:
> 
> On Wed, Dec 11, 2019 at 4:06 PM Wilfredo Sánchez Vega  > wrote:
>   With Python 2.7 support dropping in a matter of weeks, I'd like to pick up 
> from hawkowl's thread back in March about Python 2.7 support for Twisted.
> 
> Despite the widely circulated January 1 2020 date, it seems that python-dev 
> nevertheless plans to make a Python 2.7 release in April 2020 - 
> https://www.python.org/dev/peps/pep-0373/ 
> 
> 
> This is not to say the questions here don't need answering or that there 
> isn't some urgency at this point, but it seems like the January 1 date is 
> essentially an arbitrary deadline without a clear connection to the support 
> status of CPython 2.7.
> 
> Or does anyone know a different way to reconcile these apparently conflicting 
> dates?
> 
> Jean-Paul

___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
https://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] The Python 2.7 Plan

2019-12-11 Thread John Santos


On 12/11/2019 4:06 PM, Wilfredo Sánchez Vega wrote:


John Santos:


I hope/expect that none of my code changes to make my source compatible
with both 2.7 and 3 will break when Twisted support for 2.7 goes away!
(It seems to me the Twisted compatibility policy would guarantee that.)

   To be clear, I would not expect this to be the case if you update Twisted to 
a version that no longer supports Python 2.7.  You would have to continue using 
a version that does support Python 2.7. You should have some runway, however, 
in which your app still works with either Py2.7 and Twisted 19 as well as Py3.8 
using Twisted 20, for example.


WHAT?

You are saying that I will still have to use a version of Twisted that 
supports Python 2.7, even though I AM NOT USING Python 2.7?


If that's not what you meant, than clarify.



-wsv

___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
https://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


--
John Santos
Evans Griffiths & Hart, Inc.
781-861-0670 ext 539

___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
https://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python