[Twisted-Python] Twisted 21.7.0 Pre-Release Announcement
![](https://secure.gravatar.com/avatar/c194a4d2f2f8269aa052942e87985198.jpg?s=120&d=mm&r=g)
On behalf of the Twisted contributors I announce the release candidate of Twisted 21.7.0 This is mostly a bugfix release. *Python 3.5 is no longer a supported platform.* *The minimum supported platform is Python 3.6.7.* The notable features are: - Python 3.10 beta is now a supported platform. - twisted.web.template.renderElement() now accepts any IRequest implementer instead of only twisted.web.server.Request. Add type hints to twisted.web.template. (#10184) The release and NEWS file is available for review at https://github.com/twisted/twisted/pull/1614/files Release candidate documentation is available at https://twisted--1614.org.readthedocs.build/en/1614/ Wheels for the release candidate are available on PyPI https://pypi.org/project/Twisted/21.7.0rc1/ python -m pip install Twisted==21.7.0rc1 Please test it and report any issues. If nothing comes up in 1 week, 21.7.0 will be released based on the latest release candidate. Many thanks to everyone who had a part in Twisted - the supporters of the Twisted Software Foundation, the developers, and all the people testing and building great things with Twisted! -- Adi Roiban
![](https://secure.gravatar.com/avatar/e1554622707bedd9202884900430b838.jpg?s=120&d=mm&r=g)
Thank you Adi! Very glad to see us collectively getting back on the release-management horse again! And it was super encouraging to see how quickly you were able to get this out, with all the automation that everyone (not least of all yourself) has been building to make this process faster and simpler. It appears we've buried the lede on one of our biggest features in this release though - https://github.com/twisted/twisted/pull/1448/files <https://github.com/twisted/twisted/pull/1448/files> had no newsfile that shows up in the changelog, but it properly made Deferred into a generic, so I think this is the first release of Twisted where you might reasonably be able to use mypy without your own custom stub files! :) -g
![](https://secure.gravatar.com/avatar/eba6eb871de2549c7447a8701352cd35.jpg?s=120&d=mm&r=g)
On Sun, 11 Jul 2021 at 00:49, Glyph <glyph@twistedmatrix.com> wrote:
Thanks Glyph and Thomas and Tom for the release notes feedback. I was thinking that 21.7.0 is ready for the final review. PR at https://github.com/twisted/twisted/pull/1614 I am doing some fast-tracking here (as I now have some time) But while writing this email, the python 3.8 and 3.9 version on GitHub VMs were updates and we now have broken tests in trunk and in the release branch The release blocking ticket was created at https://twistedmatrix.com/trac/ticket/10230 Please see if you can help with unlocking the release. Thomas is already helping. Either fix the issue, or decide if it's ok to release with this issue. There was also another minor idna pypy update release blocker that was already fixed by Thomas. I was planning to push the final release on Saturday 17 of July, to allow for a full 1 week of feedback for the release candidate. --------- There is also a PR for updating the release docs - https://github.com/twisted/twisted/pull/1616 Regards -- Adi Roiban
![](https://secure.gravatar.com/avatar/e5a514e14e44913930aa1ac15f508746.jpg?s=120&d=mm&r=g)
On 11/07/2021 00:49, Glyph wrote:
To echo this: thank you for your work, Adi!
This looks very cool, but presents us with a problem. mypy now complains about instantiations of Deferred without a type annotation:
d = defer.Deferred()
results in an error:
synapse/util/async_helpers.py:124: error: Need type annotation for 'd' [var-annotated]
We can't just go and add type annotations because we need to maintain compatibility with older Twisted (to make it possible to package in Debian et al). Any suggestions for keeping mypy happy?
![](https://secure.gravatar.com/avatar/cf223b7cf77583c0a2665bad01f84f11.jpg?s=120&d=mm&r=g)
On Thursday, 15 July 2021 17:00:06 BST Richard van der Hoff wrote:
What is the minimum version of Python 3 that is supported? Does that minimum versions not have the typing feature that is used? Also I thought that mypy could imply the type of d from the assignment. Or is that that it could later... Disclaimer, my mypy use is not that deep yet. Barry
![](https://secure.gravatar.com/avatar/e5a514e14e44913930aa1ac15f508746.jpg?s=120&d=mm&r=g)
On 16/07/2021 00:18, Glyph wrote:
Ah, this gave me the clue I needed. We just need to run against them. Which means I can put type hints in comments, where they will be ignored at runtime. It's fiddly, but it will work well enough. Thanks Glyph, and thanks to Adi and Barry for your suggestions too. One particular problem I came across was the type annotation on inlineCallbacks. I've filed https://twistedmatrix.com/trac/ticket/10231 about it - would appreciate thoughts.
![](https://secure.gravatar.com/avatar/e1554622707bedd9202884900430b838.jpg?s=120&d=mm&r=g)
You can also do 'from __future__ import annotations' to avoid the annotations getting evaluated, which might be slightly less awkward.
Thanks Glyph, and thanks to Adi and Barry for your suggestions too.
One particular problem I came across was the type annotation on inlineCallbacks. I've filed https://twistedmatrix.com/trac/ticket/10231 <https://twistedmatrix.com/trac/ticket/10231> about it - would appreciate thoughts.
This definitely looks wrong; there should be a TypeVar in there. Adi, I'd go so far as to say that this should be a release blocker, although the change should be fairly minimal. Richard, could you please make a proper PR for this to get CI kicked off and make sure the new annotation doesn't cause any failures? -g
![](https://secure.gravatar.com/avatar/eba6eb871de2549c7447a8701352cd35.jpg?s=120&d=mm&r=g)
On Fri, 16 Jul 2021 at 20:27, Glyph <glyph@twistedmatrix.com> wrote:
I think that I will do a RC2 release candidate, since due to this issue the GHA tests on RC1 are red - https://github.com/twisted/twisted/pull/1628 So I plan to cherry-pick those changes and do a RC2. Regarding the release blocker, I will block the release for any ticket from https://twistedmatrix.com/trac/report/26 Right now, I have added https://twistedmatrix.com/trac/ticket/10231 to that report. So, if anyone knows how to fix https://twistedmatrix.com/trac/ticket/10231 please help to unblock the release. Or if you think that https://twistedmatrix.com/trac/ticket/10231 should not be a release blocker, please add your comments. For now, I will delay the release of RC2 to wait to see what is the resolution for #10231 Regards -- Adi Roiban
![](https://secure.gravatar.com/avatar/e5a514e14e44913930aa1ac15f508746.jpg?s=120&d=mm&r=g)
On 16/07/2021 20:27, Glyph wrote:
Done, in the form of https://github.com/twisted/twisted/pull/1632.
![](https://secure.gravatar.com/avatar/8eabc589f286a7dbd53d2a384a61d657.jpg?s=120&d=mm&r=g)
Hi guys I'm new to twisted and would appreciate some beginner guidance. I'm trying to use the "python -m twisted.conch.stdio" command in command prompt but it does not work and gives the following error: C:\WINDOWS\system32>python -m twisted.conch C:\Users\Melanie\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\python.exe: No module named twisted.conch.*main*; 'twisted.conch' is a package and cannot be directly executed *I'm hoping that this will solve the rest of the error messages I'm having. I want to eventually be ably to run :*
*The aim is to get the deferred responses as shown in previous code, but all I get is:*
Please help. I'm trying to send this to the twisted mailing group. If I'm wrong please nudge me in the right direction. Thanks in advance. M On Mon, Jul 19, 2021 at 12:43 AM Richard van der Hoff <richard@matrix.org> wrote:
![](https://secure.gravatar.com/avatar/e1554622707bedd9202884900430b838.jpg?s=120&d=mm&r=g)
Hi Melanie! Welcome to the community. I hope we can get you set up better.
I'm trying to use the "python -m twisted.conch.stdio" command in command prompt but it does not work and gives the following error:
C:\WINDOWS\system32>python -m twisted.conch C:\Users\Melanie\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\python.exe: No module named twisted.conch.main; 'twisted.conch' is a package and cannot be directly executed
In this example you're doing `python -m twisted.conch`, not `python -m twisted.conch.stdio`, which will not work anywhere. Unfortunately, the Conch standard-IO library (and therefore the conch terminal client, and twisted.conch.stdio) doesn't work on Windows and never has: https://twistedmatrix.com/trac/ticket/2157 <https://twistedmatrix.com/trac/ticket/2157>. However, you may be able to get it up and running with the Windows Subsystem for Linux, which I believe will present a Linux-like interface since as far as the application knows it's running on Linux: https://docs.microsoft.com/en-us/windows/wsl/about <https://docs.microsoft.com/en-us/windows/wsl/about>
Or, for that matter, could you just write a little program? A sample Python script that runs the reactor is probably easier to set up than a reactor-enabled REPL, particularly on Windows. (There are various options for a reactor-enabled REPL, it's definitely doable, but it might be a bit rough as a first step; as you're discovering.)
Please help. I'm trying to send this to the twisted mailing group. If I'm wrong please nudge me in the right direction.
This is as good a place as any :).
![](https://secure.gravatar.com/avatar/eba6eb871de2549c7447a8701352cd35.jpg?s=120&d=mm&r=g)
On Sun, 18 Jul 2021 at 23:42, Richard van der Hoff <richard@matrix.org> wrote:
Thanks to Thomas and Richard 21.7.0 RC2 was released. Release notes https://github.com/twisted/twisted/releases/tag/twisted-21.7.0rc2 PyPy page https://pypi.org/project/Twisted/21.7.0rc2/ Please test and send any issue over email or GitHub Pull request at https://github.com/twisted/twisted/pull/1614 If all is ok, I plan to do the final release by the end of Friday or during the weekend. -- Adi Roiban
![](https://secure.gravatar.com/avatar/8285ea1765ae52a3ab79c767676a2f4e.jpg?s=120&d=mm&r=g)
Hi all, I just finally got around to installing and testing the new RC with our primary Twisted App. Everything seems to work fine. I continue to be impressed by what a good job Twisted does with backwards compatibility! -- John Santos On 7/20/2021 7:23 PM, Adi Roiban wrote:
-- John Santos Evans Griffiths & Hart, Inc. 781-861-0670 ext 539
![](https://secure.gravatar.com/avatar/eba6eb871de2549c7447a8701352cd35.jpg?s=120&d=mm&r=g)
Hi, Thanks for all of you who have sent comments and fixes for RC2. The third release candidate is available for download and testing https://pypi.org/project/Twisted/21.7.0rc3/#files https://github.com/twisted/twisted/releases/tag/twisted-21.7.0rc3 This contains 2 changes: The wheel file is now published to PyPi. The following revert was done: * The ticket in which the regression was reported https://twistedmatrix.com/trac/ticket/10235 * Reverted ticket https://twistedmatrix.com/trac/ticket/10155 * Reverted PR https://github.com/twisted/twisted/pull/1570 -------------- You can send your comments over email or over GitHub https://github.com/twisted/twisted/pull/1614 I plan to do the final release by the end of Sunday UTC time. Regards On Wed, 21 Jul 2021 at 19:07, John Santos <john@egh.com> wrote:
-- Adi Roiban
![](https://secure.gravatar.com/avatar/eba6eb871de2549c7447a8701352cd35.jpg?s=120&d=mm&r=g)
Hi Just a quick update. The release is on hold as I am waiting for Thomas to check a possible regression. I don't know when the results from the investigation will be available. I hope for the end of today. Will be back with more details. Cheers On Fri, 23 Jul 2021, 10:55 Adi Roiban, <adiroiban@gmail.com> wrote:
![](https://secure.gravatar.com/avatar/eba6eb871de2549c7447a8701352cd35.jpg?s=120&d=mm&r=g)
On Mon, 26 Jul 2021 at 06:57, Adi Roiban <adiroiban@gmail.com> wrote:
The final release is ready for review https://github.com/twisted/twisted/pull/1614 Please take a look and leave your comments over GitHub. Once the PR is approved I will create the final release. Cheers -- Adi Roiban
![](https://secure.gravatar.com/avatar/e1554622707bedd9202884900430b838.jpg?s=120&d=mm&r=g)
Thank you Adi! Very glad to see us collectively getting back on the release-management horse again! And it was super encouraging to see how quickly you were able to get this out, with all the automation that everyone (not least of all yourself) has been building to make this process faster and simpler. It appears we've buried the lede on one of our biggest features in this release though - https://github.com/twisted/twisted/pull/1448/files <https://github.com/twisted/twisted/pull/1448/files> had no newsfile that shows up in the changelog, but it properly made Deferred into a generic, so I think this is the first release of Twisted where you might reasonably be able to use mypy without your own custom stub files! :) -g
![](https://secure.gravatar.com/avatar/eba6eb871de2549c7447a8701352cd35.jpg?s=120&d=mm&r=g)
On Sun, 11 Jul 2021 at 00:49, Glyph <glyph@twistedmatrix.com> wrote:
Thanks Glyph and Thomas and Tom for the release notes feedback. I was thinking that 21.7.0 is ready for the final review. PR at https://github.com/twisted/twisted/pull/1614 I am doing some fast-tracking here (as I now have some time) But while writing this email, the python 3.8 and 3.9 version on GitHub VMs were updates and we now have broken tests in trunk and in the release branch The release blocking ticket was created at https://twistedmatrix.com/trac/ticket/10230 Please see if you can help with unlocking the release. Thomas is already helping. Either fix the issue, or decide if it's ok to release with this issue. There was also another minor idna pypy update release blocker that was already fixed by Thomas. I was planning to push the final release on Saturday 17 of July, to allow for a full 1 week of feedback for the release candidate. --------- There is also a PR for updating the release docs - https://github.com/twisted/twisted/pull/1616 Regards -- Adi Roiban
![](https://secure.gravatar.com/avatar/e5a514e14e44913930aa1ac15f508746.jpg?s=120&d=mm&r=g)
On 11/07/2021 00:49, Glyph wrote:
To echo this: thank you for your work, Adi!
This looks very cool, but presents us with a problem. mypy now complains about instantiations of Deferred without a type annotation:
d = defer.Deferred()
results in an error:
synapse/util/async_helpers.py:124: error: Need type annotation for 'd' [var-annotated]
We can't just go and add type annotations because we need to maintain compatibility with older Twisted (to make it possible to package in Debian et al). Any suggestions for keeping mypy happy?
![](https://secure.gravatar.com/avatar/cf223b7cf77583c0a2665bad01f84f11.jpg?s=120&d=mm&r=g)
On Thursday, 15 July 2021 17:00:06 BST Richard van der Hoff wrote:
What is the minimum version of Python 3 that is supported? Does that minimum versions not have the typing feature that is used? Also I thought that mypy could imply the type of d from the assignment. Or is that that it could later... Disclaimer, my mypy use is not that deep yet. Barry
![](https://secure.gravatar.com/avatar/e5a514e14e44913930aa1ac15f508746.jpg?s=120&d=mm&r=g)
On 16/07/2021 00:18, Glyph wrote:
Ah, this gave me the clue I needed. We just need to run against them. Which means I can put type hints in comments, where they will be ignored at runtime. It's fiddly, but it will work well enough. Thanks Glyph, and thanks to Adi and Barry for your suggestions too. One particular problem I came across was the type annotation on inlineCallbacks. I've filed https://twistedmatrix.com/trac/ticket/10231 about it - would appreciate thoughts.
![](https://secure.gravatar.com/avatar/e1554622707bedd9202884900430b838.jpg?s=120&d=mm&r=g)
You can also do 'from __future__ import annotations' to avoid the annotations getting evaluated, which might be slightly less awkward.
Thanks Glyph, and thanks to Adi and Barry for your suggestions too.
One particular problem I came across was the type annotation on inlineCallbacks. I've filed https://twistedmatrix.com/trac/ticket/10231 <https://twistedmatrix.com/trac/ticket/10231> about it - would appreciate thoughts.
This definitely looks wrong; there should be a TypeVar in there. Adi, I'd go so far as to say that this should be a release blocker, although the change should be fairly minimal. Richard, could you please make a proper PR for this to get CI kicked off and make sure the new annotation doesn't cause any failures? -g
![](https://secure.gravatar.com/avatar/eba6eb871de2549c7447a8701352cd35.jpg?s=120&d=mm&r=g)
On Fri, 16 Jul 2021 at 20:27, Glyph <glyph@twistedmatrix.com> wrote:
I think that I will do a RC2 release candidate, since due to this issue the GHA tests on RC1 are red - https://github.com/twisted/twisted/pull/1628 So I plan to cherry-pick those changes and do a RC2. Regarding the release blocker, I will block the release for any ticket from https://twistedmatrix.com/trac/report/26 Right now, I have added https://twistedmatrix.com/trac/ticket/10231 to that report. So, if anyone knows how to fix https://twistedmatrix.com/trac/ticket/10231 please help to unblock the release. Or if you think that https://twistedmatrix.com/trac/ticket/10231 should not be a release blocker, please add your comments. For now, I will delay the release of RC2 to wait to see what is the resolution for #10231 Regards -- Adi Roiban
![](https://secure.gravatar.com/avatar/e5a514e14e44913930aa1ac15f508746.jpg?s=120&d=mm&r=g)
On 16/07/2021 20:27, Glyph wrote:
Done, in the form of https://github.com/twisted/twisted/pull/1632.
![](https://secure.gravatar.com/avatar/8eabc589f286a7dbd53d2a384a61d657.jpg?s=120&d=mm&r=g)
Hi guys I'm new to twisted and would appreciate some beginner guidance. I'm trying to use the "python -m twisted.conch.stdio" command in command prompt but it does not work and gives the following error: C:\WINDOWS\system32>python -m twisted.conch C:\Users\Melanie\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\python.exe: No module named twisted.conch.*main*; 'twisted.conch' is a package and cannot be directly executed *I'm hoping that this will solve the rest of the error messages I'm having. I want to eventually be ably to run :*
*The aim is to get the deferred responses as shown in previous code, but all I get is:*
Please help. I'm trying to send this to the twisted mailing group. If I'm wrong please nudge me in the right direction. Thanks in advance. M On Mon, Jul 19, 2021 at 12:43 AM Richard van der Hoff <richard@matrix.org> wrote:
![](https://secure.gravatar.com/avatar/e1554622707bedd9202884900430b838.jpg?s=120&d=mm&r=g)
Hi Melanie! Welcome to the community. I hope we can get you set up better.
I'm trying to use the "python -m twisted.conch.stdio" command in command prompt but it does not work and gives the following error:
C:\WINDOWS\system32>python -m twisted.conch C:\Users\Melanie\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\python.exe: No module named twisted.conch.main; 'twisted.conch' is a package and cannot be directly executed
In this example you're doing `python -m twisted.conch`, not `python -m twisted.conch.stdio`, which will not work anywhere. Unfortunately, the Conch standard-IO library (and therefore the conch terminal client, and twisted.conch.stdio) doesn't work on Windows and never has: https://twistedmatrix.com/trac/ticket/2157 <https://twistedmatrix.com/trac/ticket/2157>. However, you may be able to get it up and running with the Windows Subsystem for Linux, which I believe will present a Linux-like interface since as far as the application knows it's running on Linux: https://docs.microsoft.com/en-us/windows/wsl/about <https://docs.microsoft.com/en-us/windows/wsl/about>
Or, for that matter, could you just write a little program? A sample Python script that runs the reactor is probably easier to set up than a reactor-enabled REPL, particularly on Windows. (There are various options for a reactor-enabled REPL, it's definitely doable, but it might be a bit rough as a first step; as you're discovering.)
Please help. I'm trying to send this to the twisted mailing group. If I'm wrong please nudge me in the right direction.
This is as good a place as any :).
![](https://secure.gravatar.com/avatar/eba6eb871de2549c7447a8701352cd35.jpg?s=120&d=mm&r=g)
On Sun, 18 Jul 2021 at 23:42, Richard van der Hoff <richard@matrix.org> wrote:
Thanks to Thomas and Richard 21.7.0 RC2 was released. Release notes https://github.com/twisted/twisted/releases/tag/twisted-21.7.0rc2 PyPy page https://pypi.org/project/Twisted/21.7.0rc2/ Please test and send any issue over email or GitHub Pull request at https://github.com/twisted/twisted/pull/1614 If all is ok, I plan to do the final release by the end of Friday or during the weekend. -- Adi Roiban
![](https://secure.gravatar.com/avatar/8285ea1765ae52a3ab79c767676a2f4e.jpg?s=120&d=mm&r=g)
Hi all, I just finally got around to installing and testing the new RC with our primary Twisted App. Everything seems to work fine. I continue to be impressed by what a good job Twisted does with backwards compatibility! -- John Santos On 7/20/2021 7:23 PM, Adi Roiban wrote:
-- John Santos Evans Griffiths & Hart, Inc. 781-861-0670 ext 539
![](https://secure.gravatar.com/avatar/eba6eb871de2549c7447a8701352cd35.jpg?s=120&d=mm&r=g)
Hi, Thanks for all of you who have sent comments and fixes for RC2. The third release candidate is available for download and testing https://pypi.org/project/Twisted/21.7.0rc3/#files https://github.com/twisted/twisted/releases/tag/twisted-21.7.0rc3 This contains 2 changes: The wheel file is now published to PyPi. The following revert was done: * The ticket in which the regression was reported https://twistedmatrix.com/trac/ticket/10235 * Reverted ticket https://twistedmatrix.com/trac/ticket/10155 * Reverted PR https://github.com/twisted/twisted/pull/1570 -------------- You can send your comments over email or over GitHub https://github.com/twisted/twisted/pull/1614 I plan to do the final release by the end of Sunday UTC time. Regards On Wed, 21 Jul 2021 at 19:07, John Santos <john@egh.com> wrote:
-- Adi Roiban
![](https://secure.gravatar.com/avatar/eba6eb871de2549c7447a8701352cd35.jpg?s=120&d=mm&r=g)
Hi Just a quick update. The release is on hold as I am waiting for Thomas to check a possible regression. I don't know when the results from the investigation will be available. I hope for the end of today. Will be back with more details. Cheers On Fri, 23 Jul 2021, 10:55 Adi Roiban, <adiroiban@gmail.com> wrote:
![](https://secure.gravatar.com/avatar/eba6eb871de2549c7447a8701352cd35.jpg?s=120&d=mm&r=g)
On Mon, 26 Jul 2021 at 06:57, Adi Roiban <adiroiban@gmail.com> wrote:
The final release is ready for review https://github.com/twisted/twisted/pull/1614 Please take a look and leave your comments over GitHub. Once the PR is approved I will create the final release. Cheers -- Adi Roiban
participants (7)
-
Adi Roiban
-
Adi Roiban
-
Barry Scott
-
Glyph
-
John Santos
-
Melanie Molifie
-
Richard van der Hoff