[Twisted-Python] Automatically get dependencies in Buildbot

2014-12-04 Thread Adi Roiban
Hi,

What do you say if Twisted buildbot would  be change to automatically
update dependencies before each test?

I have pushed some code here
https://github.com/twisted-infra/twisted-buildbot-configuration/pull/7 just
to start the conversation.

In this way, it  should be much easier to add new dependencies or to update
current dependencies... For example the patch from #7066 can not be tested
on current infrastructure.

I think the GitHub review is a better place to discuss this.

I have used a similar approach on my project which depends on about 100
packages (runtime, buildtime, ex sphinx and testing) and the whole step
takes 2 seconds (Unix/Linux/Windows) with a local cache and a local network
PyPi mirror (https://pypi.python.org/pypi/pypiserver)
With fixed version in dependencies, I never got any trouble.

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


[Twisted-Python] Catch clientConnectionLost in a Factory

2014-12-04 Thread Grigorescu Ciprian
Hello,
I have a small problem. I using SMTPClient and ClientFactory in order to send 
emails. I have something like:observer['workers'] = total mails to 
send(connections)
    
    def got_result(*args):
    observer['results'] += 1

    def got_error(err):
    observer['errors'] += 1

    def got_end(_):
    if observer['results'] + observer['errors'] == observer['workers']:
    reactor.stop()

    factory = SomeFactory(...)    reactor.connectTCP(...)
    d.addCallbacks(got_result, got_error)
    d.addBoth(got_end)

class SomeFactory(ClientFactory):

    def clientConnectionLost(self, connector, reason):
    self.error_handle(reason)

    def error_handle(self, reason):
    if self.deferred is not None:
    d, self.deferred = self.deferred, None
    d.errback(reason)


Everything  is working ok if I don't have errors like: [Failure instance: 
Traceback (failure with no frames): : Connection to the other side was lost 
in a non-clean fashion: Connection lost.When I have a error like that, the 
rector is not stopping because the error counter is not incrementing. But when 
I kill the reactor, got_error() receive the errors and observer['results'] + 
observer['errors'] == observer['workers'] is evaluated and the reactor 
stops(with a error of course, Can't stop reactor that isn't running :)).

I don't understand how can I make this work. Can someone help me?
Thanks,

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


Re: [Twisted-Python] doc bloat

2014-12-04 Thread Glyph

> On Dec 3, 2014, at 18:46, exar...@twistedmatrix.com wrote:
> 
> On 12:55 am, gl...@twistedmatrix.com wrote:
>> 
>>> On Dec 2, 2014, at 20:05, exar...@twistedmatrix.com wrote:
>> 
>>> Are there lots of useless docstrings on nested function definitions purely 
>>> for the sake of twistedchecker?  Or are there undocumented nested functions 
>>> that are actually a little bit difficult to understand on their own?
>> 
>> twistedchecker does not presently require nested function definitions to 
>> have docstrings.  I recently merged a fix to an incongruity where it was 
>> requiring this of classes defined within functions: 
>> .
>>  So this one, at least, we can cross off for the future :).
> 
> The broader context of this suggestion was that we should inspect the 
> codebase to see what policy changes would improve the quality of the 
> code/documentation while reducing the effort required to develop and maintain 
> it.
> 
> It sounds like you have some ideas about such changes already.  Does that 
> mean you'd like to suggest them (presumably in the form of issues filed 
> against twistedhecker) instead of doing this investigation?

In this one case, I believed I was simply bringing our tooling into line with 
existing policy.  twistedchecker already doesn't require docstrings on 
callbacks, it seemed like a clear bug that it required docstrings on those 
callbacks if they existed inside a class statement.

The letter of the policy is a little ambiguous, and perhaps it should be 
updated.  
>
 says docstrings "should" always be used, but it doesn't say "must".  And, as 
written, it has no exception for callbacks, which clearly contravenes our 
existing tooling and practice.

I do have a couple of other more specific ideas and I will almost certainly 
file twistedchecker issues for them :).

More broadly speaking I think it would be great to have some investigation into 
our code-quality issues.  I think that there are definitely lots of useless 
docstrings for the sake of twistedchecker, and I'm not quite sure how to 
classify those.

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


Re: [Twisted-Python] patch for t.p.logger.SyslogObserver (was #7549)

2014-12-04 Thread Glyph

> On Dec 3, 2014, at 22:55, Roberto Polli  wrote:
> 
> Hi Glyph|all,
> 
> I just noticed the t.p.logger is gone (or integrated). This made 
> the patch for supporting logLevels in t.p.syslog straightforward: 

It's not dead, it's just... resting.

More details here: 
>

> https://twistedmatrix.com/trac/attachment/ticket/7549/syslog-loglevels-7549.patch
> 
> There are plenty of tests and it worked nicely on my env,
> allowing rsyslog to split my twistd app log in various files with different
> priorities.
> 
> If you see some flaw in the tests just let me know... once I roll it 
> for a while on my apps I'll put the ticket in review.
> 
> Sorry for the great delay :( 

Thanks for your contribution!  I'll probably only look at the tests once it's 
in review, though ;).

-glyph

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


Re: [Twisted-Python] Automatically get dependencies in Buildbot

2014-12-04 Thread Glyph

> On Dec 4, 2014, at 14:48, Adi Roiban  wrote:
> 
> I think the GitHub review is a better place to discuss this.

It looks like adi got his wish - in case anyone else is interested, 
> has 
been quite active :).

-g

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