Re: [Twisted-Python] Enable pre-commit.ci for twisted/twisted

2021-07-15 Thread Hynek Schlawack

>> I am +0 on this change due to security reasons...but I do think that it will 
>> reduce a bit of the frustration for first time contributors.
>> 
> 
> I'm +1; we've accepted a lot of cloud risk already, and this seems like a lot 
> of benefit for minimal additional risk.  Is this asottile running the show?  
> The website is not entirely clear.

He is. I’ve had it enabled on both structlog & argon2-cffi for a while now FWIW.
___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
https://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] Twisted 21.7.0 Pre-Release Announcement

2021-07-15 Thread Glyph


> On Jul 15, 2021, at 9:00 AM, Richard van der Hoff  wrote:
> 
> 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?
> 

Are you saying you need it to typecheck against older versions or just run 
against them?

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


Re: [Twisted-Python] Enable pre-commit.ci for twisted/twisted

2021-07-15 Thread Glyph


> On Jul 15, 2021, at 7:35 AM, Jean-Paul Calderone  
> wrote:
> 
> Can you elaborate on this a little bit?  First time contributors won't be 
> able to push a branch to twisted/twisted.  Does giving pre-commit.ci 
>  write access to twisted/twisted also give it write 
> access to forks of twisted/twisted?  Or maybe only to branches in forks with 
> PRs targeting twisted/twisted?
> 

I believe so.  As a Twisted contributor you can actually push to branches of 
any user targeting a PR in Twisted.  I'm pretty sure repo:write for a github 
app grants the app similar access to a human org member.

I can't remember the exact mechanics of how this is configured, but I think 
that it's a side-effect of the "Require branches to be up to date before 
merging" setting being enabled, because that setting adds the "update branch" 
button to out-of-date PRs which implicitly gives the org push permission.

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


Re: [Twisted-Python] Enable pre-commit.ci for twisted/twisted

2021-07-15 Thread Glyph


> On Jul 15, 2021, at 7:25 AM, Adi Roiban  wrote:
> 
> I am +0 on this change due to security reasons...but I do think that it will 
> reduce a bit of the frustration for first time contributors.
> 

I'm +1; we've accepted a lot of cloud risk already, and this seems like a lot 
of benefit for minimal additional risk.  Is this asottile running the show?  
The website is not entirely clear.

It would be extra nice if we could restrict it from pushing to `trunk` on its 
own though, or running any release automation.

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


Re: [Twisted-Python] Twisted 21.7.0 Pre-Release Announcement

2021-07-15 Thread Adi Roiban
On Thu, 15 Jul 2021 at 17:02, Richard van der Hoff 
wrote:

> On 11/07/2021 00:49, Glyph wrote:
>
> 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.
>
> To echo this: thank you for your work, Adi!
>
> 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 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! :)
>
> 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?
>
I also don't have much experience with mypy, but I guess that you can
ignore the errors from twisted.internet.defer via mypy.ini

[mypy-twisted.internet.defer]
allow_untyped_defs = True

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


Re: [Twisted-Python] Twisted 21.7.0 Pre-Release Announcement

2021-07-15 Thread Barry Scott
On Thursday, 15 July 2021 17:00:06 BST Richard van der Hoff wrote:
> On 11/07/2021 00:49, Glyph wrote:
> > 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.
> >
> To echo this: thank you for your work, Adi!
> 
> > 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 
> >  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! :)
> 
> 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?

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



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


Re: [Twisted-Python] Twisted 21.7.0 Pre-Release Announcement

2021-07-15 Thread Richard van der Hoff

On 11/07/2021 00:49, Glyph wrote:
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.



To echo this: thank you for your work, Adi!

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 
 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! :)


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?



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


Re: [Twisted-Python] Enable pre-commit.ci for twisted/twisted

2021-07-15 Thread Jean-Paul Calderone
On Thu, Jul 15, 2021 at 10:26 AM Adi Roiban  wrote:

> Hi,
>
> As part of this PR https://github.com/twisted/twisted/pull/1619 Thomas
> has requested to enable the https://pre-commit.ci  service for
> twisted/twisted repository
>
> The pre-commit.ci is kind of an auto-pilot for our pre-commit
> configuration.
>
> We already do post-commit checks via the pre-commit framework and I think
> that some of the core developers have pre-commit enabled as a git hook.
>
> The convenience if pre-commit.ci is that if you don't have the git-hook
> enable and you commit dirty code, pre-commit.ci will fix it for you.
>
> pre-commit.ci will also automatically create PR to update the pre-commit
> dependencies.
>
> This all comes at the cost of allowing the external pre-commit.ci server
> to write to twisted/twisted repository.
>
> pre-commit.ci was already enabled for twisted/ldaptor
>
> pre-commit.ci is currently enabled for twisted/twisted for testing while
> a final decision is made.
>
> I am +0 on this change due to security reasons...but I do think that it
> will reduce a bit of the frustration for first time contributors.
>

Can you elaborate on this a little bit?  First time contributors won't be
able to push a branch to twisted/twisted.  Does giving pre-commit.ci write
access to twisted/twisted also give it write access to forks of
twisted/twisted?  Or maybe only to branches in forks with PRs targeting
twisted/twisted?


> If there are no strong comments against enabling pre-commit.ci, in a
> week, I plan to approve the PR and have the pre-commit.ci enabled for the
> long term.
>

Thanks for raising this question with the mailing list and for supplying
details about the motivation.  Given that there is no justification for the
change written on the ticket or in the PR itself, this is really helpful.

Thanks,
Jean-Paul


> We can always rewoke to pre-commit.ci write access if needed.
>
>
Cheers
> --
> Adi Roiban
> ___
> Twisted-Python mailing list
> Twisted-Python@twistedmatrix.com
> https://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>
___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
https://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


[Twisted-Python] Enable pre-commit.ci for twisted/twisted

2021-07-15 Thread Adi Roiban
Hi,

As part of this PR https://github.com/twisted/twisted/pull/1619 Thomas has
requested to enable the https://pre-commit.ci  service for twisted/twisted
repository

The pre-commit.ci is kind of an auto-pilot for our pre-commit configuration.

We already do post-commit checks via the pre-commit framework and I think
that some of the core developers have pre-commit enabled as a git hook.

The convenience if pre-commit.ci is that if you don't have the git-hook
enable and you commit dirty code, pre-commit.ci will fix it for you.

pre-commit.ci will also automatically create PR to update the pre-commit
dependencies.

This all comes at the cost of allowing the external pre-commit.ci server to
write to twisted/twisted repository.

pre-commit.ci was already enabled for twisted/ldaptor

pre-commit.ci is currently enabled for twisted/twisted for testing while a
final decision is made.

I am +0 on this change due to security reasons...but I do think that it
will reduce a bit of the frustration for first time contributors.

If there are no strong comments against enabling pre-commit.ci, in a week,
I plan to approve the PR and have the pre-commit.ci enabled for the long
term.

We can always rewoke to pre-commit.ci write access if needed.

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


Re: [Twisted-Python] Twisted 21.7.0 Pre-Release Announcement

2021-07-15 Thread Adi Roiban
On Sun, 11 Jul 2021 at 00:49, Glyph  wrote:

> 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 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! :)
>

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
___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
https://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python