[Twisted-Python] Twisted 21.2.0rc1 Release Candidate Announcement
![](https://secure.gravatar.com/avatar/469df05f5dfd5b75fb3cb3a0868d36bf.jpg?s=120&d=mm&r=g)
It's time for another Twisted release! There are two major announcements for this release: - *Python 2.7 support has been dropped*. Twisted 21.2.0 supports Python 3.5 and higher only - *This will be the last Twisted release to support Python 3.5*. Twisted 21.2.0rc1 brings the following: - twist dns --pyzone now works on Python 3 - twisted.web.twcgi now works on Python 3 - all tests pass on all platforms on Python 3.8, including asyncio tests on Windows - tests pass on Python 3.9 (thanks to Michał Górny) - type hints, as specified in PEP 484, are now used in functions throughout the codebase - mypy (static type checker) is now run over the codebase during CI to help detect problems, and help improve the use of types - code in is now formatted with Black (thanks to Tom Most) - many CI and automation improvements (thanks to Adi Roiban and Thomas Grainger) - many more fixes (225 tickets closed!) You can install by running this command: python -m pip install Twisted==21.2.0rc1 The full tarball is available at: https://pypi.org/project/Twisted/21.2.0rc1/#files The full NEWS file with all changes is at: https://github.com/twisted/twisted/blob/twisted-21.2.0rc1/NEWS.rst Please test it, and let me know how your applications fare, good or bad! If nothing comes up, 21.2 will release very soon. -- Craig
![](https://secure.gravatar.com/avatar/d3dd3ba5cbd197a5927366c6c9a5003d.jpg?s=120&d=mm&r=g)
On 2021-02-14 21:53, Craig Rodrigues wrote:
Please test it, and let me know how your applications fare, good or bad!
Hi Craig, Thanks for all the work to get us into the next Twisted release. All, I went ahead and set pip_pre=true in pytest-twisted's tox.ini to try it out and got warnings/errors with PyPy 3.7 about use of t.i.d.returnValue claiming it should only be used in @inlineCallbacks decorated functions even though the location complained about is such. Only PyPy 3.7, not PyPy 3.6 nor CPython 3.7. Linux, macOS, and Windows all failed. https://github.com/pytest-dev/pytest-twisted/pull/134/checks?check_run_id=19... I also pulled a branch and PR off of the release branch and added PyPy 3.7 to the matrix. CI failed on PyPy 3.7. https://github.com/twisted/twisted/pull/1515/checks?check_run_id=1904809978 NonLocalExitTests test_returnValueNonLocalDeferred ... [FAIL] test_returnValueNonLocalWarning ... [FAIL] Ticketed as https://twistedmatrix.com/trac/ticket/10093. Seems like it might be an easy special-case fix so I'll take a look. I don't know if this qualifies as a releaser blocker or not, or if it can get cherry picked into the release anyways. Others will have to weigh in on that. I guess it's basically just lack of support for a 'new' PyPy version. PyPy 3.7 beta was released in November and alpha in September. I understand choosing not to bother fitting this in, but after blowing past CPython 3.8 and 3.9 released it would be nice to actually be all around caught up. Cheers, -kyle
![](https://secure.gravatar.com/avatar/e1554622707bedd9202884900430b838.jpg?s=120&d=mm&r=g)
Thank you Craig for getting this out! On Valentines day, no less :-) ❤️. Very excited that the release train is back on the tracks! 🚂 It's been a very rough year. Thank you to everyone who contributed to the 225 tickets that have been closed during this release, and thanks also to everyone else who is trying to accelerate the progress of the next release so the next one won't be such a massive effort to get out! -g
![](https://secure.gravatar.com/avatar/e5a514e14e44913930aa1ac15f508746.jpg?s=120&d=mm&r=g)
On 15/02/2021 02:53, Craig Rodrigues wrote:
Thanks Craig for getting this release ready. It looks like it is incompatible with Python 3.5.2: exception as below. There's no real reason you should care about this, except that it is (still!) what Ubuntu 16.04LTS ships with, and Ubuntu claim to still be supporting 16.04 until April this year, so this might catch a few people by surprise, as it did me[1]. Anyway, I suggest bumping `python_requires` in `setup.cfg` (https://github.com/twisted/twisted/blob/trunk/setup.cfg#L27), to stop the new version being installed on systems where it won't work. (env3)rav@faith:~$ python3 Python 3.5.2 (default, Oct 7 2020, 17:19:02) [GCC 5.4.0 20160609] on linux Type "help", "copyright", "credits" or "license" for more information. line 20, in <module> from twisted.python import reflect File "/home/synapse/env3/lib/python3.5/site-packages/twisted/python/reflect.py", line 377, in <module> def _safeFormat(formatter: Union[types.FunctionType, Type[str]], o: object) -> str: File "/usr/lib/python3.5/typing.py", line 552, in __getitem__ dict(self.__dict__), parameters, _root=True) File "/usr/lib/python3.5/typing.py", line 512, in __new__ for t2 in all_params - {t1} if not isinstance(t2, TypeVar)): File "/usr/lib/python3.5/typing.py", line 512, in <genexpr> for t2 in all_params - {t1} if not isinstance(t2, TypeVar)): File "/usr/lib/python3.5/typing.py", line 1077, in __subclasscheck__ if super().__subclasscheck__(cls): File "/usr/lib/python3.5/abc.py", line 225, in __subclasscheck__ for scls in cls.__subclasses__(): TypeError: descriptor '__subclasses__' of 'type' object needs an argument [1] Yes, yes, I know. I'm going to fix it real soon, I promise.
![](https://secure.gravatar.com/avatar/e5a514e14e44913930aa1ac15f508746.jpg?s=120&d=mm&r=g)
On 21/02/2021 00:31, Richard van der Hoff wrote:
It also breaks compat with treq 20.4 and earlier. This may or may not be a thing you care about: File "/home/rav/work/synapse/synapse/http/client.py", line 33, in <module> import treq File "/home/rav/work/synapse/env3/lib/python3.8/site-packages/treq/__init__.py", line 5, in <module> from treq.api import head, get, post, put, patch, delete, request File "/home/rav/work/synapse/env3/lib/python3.8/site-packages/treq/api.py", line 5, in <module> from treq.client import HTTPClient File "/home/rav/work/synapse/env3/lib/python3.8/site-packages/treq/client.py", line 11, in <module> from twisted.python.compat import _PY3, unicode ImportError: cannot import name '_PY3' from 'twisted.python.compat' (unknown location)
![](https://secure.gravatar.com/avatar/469df05f5dfd5b75fb3cb3a0868d36bf.jpg?s=120&d=mm&r=g)
On Sat, Feb 20, 2021 at 4:32 PM Richard van der Hoff <richard@matrix.org> wrote:
Awww, this is unfortunate. It looks like our CI on GitHub Actions is testing *Python 3.5.10*. Over the past year, we have added a lot of type annotations to the codebase, and it has been a struggle to still keep things working with Python 3.5, but looks like between Python 3.5.2 and 3.5.10 there were changes to Python in this area. On Sat, Feb 20, 2021 at 4:50 PM Richard van der Hoff <richard@matrix.org> wrote:
This has been fixed in newer versions of treq. Since _PY3 is prefixed by an underscore, theoretically it should not be used outside of Twisted......that means other subprojects of twisted which are not twisted/twisted! Well it looks like we are not 100% hiccup free when people upgrade, but unfortunately, the show must go on, and I guess people will have to pin to earlier versions of Python, or upgrade their code if they run into things like this. Thank you very much for testing, and providing feedback!! -- Craig
![](https://secure.gravatar.com/avatar/e5a514e14e44913930aa1ac15f508746.jpg?s=120&d=mm&r=g)
On 21/02/2021 01:36, Craig Rodrigues wrote:
As it happens, it also fails (for an import of typing.Deque) on Python 3.5.3, as used by Debian oldstable. Craig, what is your intention here? I think it's ok to drop support for these ancient versions of Python 3.5, but please could you make sure that python_requires gets set to 3.5.10 if that's what's been tested against?
![](https://secure.gravatar.com/avatar/469df05f5dfd5b75fb3cb3a0868d36bf.jpg?s=120&d=mm&r=g)
On Mon, Feb 22, 2021 at 5:30 AM Richard van der Hoff <richard@matrix.org> wrote:
Sigh. I can confirm that typing.Deque does not import on Python 3.5.2. I took an inventory of our CI, and realized that the minimum version we are testing is *3.5.4* on Azure. Can you review this which bumps the minimum version to Python 3.5.4: https://github.com/twisted/twisted/pull/1525 Once I get that in, I will cherry pick it to the release branch and push out the 21.2.0 release. -- Craig
![](https://secure.gravatar.com/avatar/469df05f5dfd5b75fb3cb3a0868d36bf.jpg?s=120&d=mm&r=g)
On Monday, February 15, 2021, Kyle Altendorf <sda@fstab.net> wrote:
Thanks for providing the fix for this: https://github.com/twisted/twisted/pull/1516 This fix will make it into the 21.2.0 release. -- Craig
![](https://secure.gravatar.com/avatar/469df05f5dfd5b75fb3cb3a0868d36bf.jpg?s=120&d=mm&r=g)
On Thu, Feb 25, 2021 at 7:03 PM Craig Rodrigues <rodrigc@crodrigues.org> wrote:
Richard, As you can see by this review comment: https://github.com/twisted/twisted/pull/1525#issuecomment-786965737 Thomas Grainger and Adi Roiban have worked together to bump up the minimum Python version to 3.5.3 for this release ( https://github.com/twisted/twisted/pull/1524 ), and are not approving the PR that I have submitted in PR 1525. Even though you approved PR 1525, I cannot merge it because only PR reviews by people with write access to the Twisted repo can be merged to the Twisted repo. I am going to proceed with the release as-is with Python 3.5.3 as the minimum version. I hope that is OK for your needs. -- Craig
![](https://secure.gravatar.com/avatar/e5a514e14e44913930aa1ac15f508746.jpg?s=120&d=mm&r=g)
On 28/02/2021 07:38, Craig Rodrigues wrote:
It looks to me like https://github.com/twisted/twisted/pull/1524 sets the minimum python version to 3.5.4, so I think we're good and #1525 should just be closed as a duplicate. Thanks for getting the release out!
![](https://secure.gravatar.com/avatar/d3dd3ba5cbd197a5927366c6c9a5003d.jpg?s=120&d=mm&r=g)
On 2021-02-14 21:53, Craig Rodrigues wrote:
Please test it, and let me know how your applications fare, good or bad!
Hi Craig, Thanks for all the work to get us into the next Twisted release. All, I went ahead and set pip_pre=true in pytest-twisted's tox.ini to try it out and got warnings/errors with PyPy 3.7 about use of t.i.d.returnValue claiming it should only be used in @inlineCallbacks decorated functions even though the location complained about is such. Only PyPy 3.7, not PyPy 3.6 nor CPython 3.7. Linux, macOS, and Windows all failed. https://github.com/pytest-dev/pytest-twisted/pull/134/checks?check_run_id=19... I also pulled a branch and PR off of the release branch and added PyPy 3.7 to the matrix. CI failed on PyPy 3.7. https://github.com/twisted/twisted/pull/1515/checks?check_run_id=1904809978 NonLocalExitTests test_returnValueNonLocalDeferred ... [FAIL] test_returnValueNonLocalWarning ... [FAIL] Ticketed as https://twistedmatrix.com/trac/ticket/10093. Seems like it might be an easy special-case fix so I'll take a look. I don't know if this qualifies as a releaser blocker or not, or if it can get cherry picked into the release anyways. Others will have to weigh in on that. I guess it's basically just lack of support for a 'new' PyPy version. PyPy 3.7 beta was released in November and alpha in September. I understand choosing not to bother fitting this in, but after blowing past CPython 3.8 and 3.9 released it would be nice to actually be all around caught up. Cheers, -kyle
![](https://secure.gravatar.com/avatar/e1554622707bedd9202884900430b838.jpg?s=120&d=mm&r=g)
Thank you Craig for getting this out! On Valentines day, no less :-) ❤️. Very excited that the release train is back on the tracks! 🚂 It's been a very rough year. Thank you to everyone who contributed to the 225 tickets that have been closed during this release, and thanks also to everyone else who is trying to accelerate the progress of the next release so the next one won't be such a massive effort to get out! -g
![](https://secure.gravatar.com/avatar/e5a514e14e44913930aa1ac15f508746.jpg?s=120&d=mm&r=g)
On 15/02/2021 02:53, Craig Rodrigues wrote:
Thanks Craig for getting this release ready. It looks like it is incompatible with Python 3.5.2: exception as below. There's no real reason you should care about this, except that it is (still!) what Ubuntu 16.04LTS ships with, and Ubuntu claim to still be supporting 16.04 until April this year, so this might catch a few people by surprise, as it did me[1]. Anyway, I suggest bumping `python_requires` in `setup.cfg` (https://github.com/twisted/twisted/blob/trunk/setup.cfg#L27), to stop the new version being installed on systems where it won't work. (env3)rav@faith:~$ python3 Python 3.5.2 (default, Oct 7 2020, 17:19:02) [GCC 5.4.0 20160609] on linux Type "help", "copyright", "credits" or "license" for more information. line 20, in <module> from twisted.python import reflect File "/home/synapse/env3/lib/python3.5/site-packages/twisted/python/reflect.py", line 377, in <module> def _safeFormat(formatter: Union[types.FunctionType, Type[str]], o: object) -> str: File "/usr/lib/python3.5/typing.py", line 552, in __getitem__ dict(self.__dict__), parameters, _root=True) File "/usr/lib/python3.5/typing.py", line 512, in __new__ for t2 in all_params - {t1} if not isinstance(t2, TypeVar)): File "/usr/lib/python3.5/typing.py", line 512, in <genexpr> for t2 in all_params - {t1} if not isinstance(t2, TypeVar)): File "/usr/lib/python3.5/typing.py", line 1077, in __subclasscheck__ if super().__subclasscheck__(cls): File "/usr/lib/python3.5/abc.py", line 225, in __subclasscheck__ for scls in cls.__subclasses__(): TypeError: descriptor '__subclasses__' of 'type' object needs an argument [1] Yes, yes, I know. I'm going to fix it real soon, I promise.
![](https://secure.gravatar.com/avatar/e5a514e14e44913930aa1ac15f508746.jpg?s=120&d=mm&r=g)
On 21/02/2021 00:31, Richard van der Hoff wrote:
It also breaks compat with treq 20.4 and earlier. This may or may not be a thing you care about: File "/home/rav/work/synapse/synapse/http/client.py", line 33, in <module> import treq File "/home/rav/work/synapse/env3/lib/python3.8/site-packages/treq/__init__.py", line 5, in <module> from treq.api import head, get, post, put, patch, delete, request File "/home/rav/work/synapse/env3/lib/python3.8/site-packages/treq/api.py", line 5, in <module> from treq.client import HTTPClient File "/home/rav/work/synapse/env3/lib/python3.8/site-packages/treq/client.py", line 11, in <module> from twisted.python.compat import _PY3, unicode ImportError: cannot import name '_PY3' from 'twisted.python.compat' (unknown location)
![](https://secure.gravatar.com/avatar/469df05f5dfd5b75fb3cb3a0868d36bf.jpg?s=120&d=mm&r=g)
On Sat, Feb 20, 2021 at 4:32 PM Richard van der Hoff <richard@matrix.org> wrote:
Awww, this is unfortunate. It looks like our CI on GitHub Actions is testing *Python 3.5.10*. Over the past year, we have added a lot of type annotations to the codebase, and it has been a struggle to still keep things working with Python 3.5, but looks like between Python 3.5.2 and 3.5.10 there were changes to Python in this area. On Sat, Feb 20, 2021 at 4:50 PM Richard van der Hoff <richard@matrix.org> wrote:
This has been fixed in newer versions of treq. Since _PY3 is prefixed by an underscore, theoretically it should not be used outside of Twisted......that means other subprojects of twisted which are not twisted/twisted! Well it looks like we are not 100% hiccup free when people upgrade, but unfortunately, the show must go on, and I guess people will have to pin to earlier versions of Python, or upgrade their code if they run into things like this. Thank you very much for testing, and providing feedback!! -- Craig
![](https://secure.gravatar.com/avatar/e5a514e14e44913930aa1ac15f508746.jpg?s=120&d=mm&r=g)
On 21/02/2021 01:36, Craig Rodrigues wrote:
As it happens, it also fails (for an import of typing.Deque) on Python 3.5.3, as used by Debian oldstable. Craig, what is your intention here? I think it's ok to drop support for these ancient versions of Python 3.5, but please could you make sure that python_requires gets set to 3.5.10 if that's what's been tested against?
![](https://secure.gravatar.com/avatar/469df05f5dfd5b75fb3cb3a0868d36bf.jpg?s=120&d=mm&r=g)
On Mon, Feb 22, 2021 at 5:30 AM Richard van der Hoff <richard@matrix.org> wrote:
Sigh. I can confirm that typing.Deque does not import on Python 3.5.2. I took an inventory of our CI, and realized that the minimum version we are testing is *3.5.4* on Azure. Can you review this which bumps the minimum version to Python 3.5.4: https://github.com/twisted/twisted/pull/1525 Once I get that in, I will cherry pick it to the release branch and push out the 21.2.0 release. -- Craig
![](https://secure.gravatar.com/avatar/469df05f5dfd5b75fb3cb3a0868d36bf.jpg?s=120&d=mm&r=g)
On Monday, February 15, 2021, Kyle Altendorf <sda@fstab.net> wrote:
Thanks for providing the fix for this: https://github.com/twisted/twisted/pull/1516 This fix will make it into the 21.2.0 release. -- Craig
![](https://secure.gravatar.com/avatar/469df05f5dfd5b75fb3cb3a0868d36bf.jpg?s=120&d=mm&r=g)
On Thu, Feb 25, 2021 at 7:03 PM Craig Rodrigues <rodrigc@crodrigues.org> wrote:
Richard, As you can see by this review comment: https://github.com/twisted/twisted/pull/1525#issuecomment-786965737 Thomas Grainger and Adi Roiban have worked together to bump up the minimum Python version to 3.5.3 for this release ( https://github.com/twisted/twisted/pull/1524 ), and are not approving the PR that I have submitted in PR 1525. Even though you approved PR 1525, I cannot merge it because only PR reviews by people with write access to the Twisted repo can be merged to the Twisted repo. I am going to proceed with the release as-is with Python 3.5.3 as the minimum version. I hope that is OK for your needs. -- Craig
![](https://secure.gravatar.com/avatar/e5a514e14e44913930aa1ac15f508746.jpg?s=120&d=mm&r=g)
On 28/02/2021 07:38, Craig Rodrigues wrote:
It looks to me like https://github.com/twisted/twisted/pull/1524 sets the minimum python version to 3.5.4, so I think we're good and #1525 should just be closed as a duplicate. Thanks for getting the release out!
participants (4)
-
Craig Rodrigues
-
Glyph
-
Kyle Altendorf
-
Richard van der Hoff