[pytest-dev] [proposal] introducing attrs to the codebase

Bruno Oliveira nicoddemus at gmail.com
Fri Jun 23 22:08:44 EDT 2017


Guys,

Just to share a thought that occurred to me while revisiting this: `attrs`
probably generates new style classes, and as we learned by now even
changing some old style classes to new style breaks the API.

https://github.com/pytest-dev/pytest/issues/2398

We will probably need to do this movement in pytest 4.0 only.

Another nice thing `attrs` would add is that it has an automatic "to_json"
method, which would make work to serialize/unserialize objects (like
pytest-xdist does today with the report objects for example) redundant.

Cheers,



On Tue, Dec 6, 2016 at 10:19 AM Florian Schulze <mail at florian-schulze.net>
wrote:

> Hi!
>
> The v16 is because it uses time based version numbering.
>
> Regards,
> Florian Schulze
>
> On 6 Dec 2016, at 12:52, Floris Bruynooghe wrote:
>
> Hi,
>
> Personally I also don't mind the dependency. Though I know in the past
> we've had a policy of keeping dependencies to a minimum as well as
> licenses. Attrs uses MIT as well so that should not be a problem.
>
> One thing which does stand out is that attrs is at v16, suggesting they
> break their API a lot. Since you work with it already I guess you have an
> idea on whether they've stabilised by now or the changes are not so bad?
>
>
> As an aside, if we're happy to introduce more libraries then maybe we
> should also consider the standard six package instead of doing our own
> stuff, mostly because I'd make it easier for new contributors.
>
> Regards,
> Floris
>
> On 6 Dec 2016 11:16, "Bruno Oliveira" <nicoddemus at gmail.com> wrote:
>
> Oh good point Raphael.
>
> Here's the link for the discussion about pip dropping Python 2.6:
> https://github.com/pypa/pip/issues/3955
>
> Cheers,
> Bruno
>
> On Tue, Dec 6, 2016 at 8:57 AM Raphael Pierzina <raphael at hackebrot.de>
> wrote:
>
>> Hey there,
>>
>> I don’t mind adding a dependency as long as there is a need for it. +1
>>
>> The problem I see with ‘attrs’ as it stands today, is that it does not
>> support Python 2.6 whereas pytest does. So we probably want to get
>> https://github.com/pytest-dev/pytest/issues/1273 in before adding
>> ‘attrs’ as a dependency. I’m not up-to-date with how things are in pip as
>> to dropping Python 2.6 compatibility. I can’t seem to find a ticket on the
>> pip issue tracker.
>>
>> Best,
>> Raphael
>>
>> On 06 Dec 2016, at 09:52, Bruno Oliveira <nicoddemus at gmail.com> wrote:
>>
>> Hi Ronny,
>>
>> Could you list the classes which you think would be changed to use
>> 'attrs'? I'm not against adding another dependency if it can help us
>> maintain the codebase. Also, introducing a new dependency should be done in
>> `3.1.0`, not in a patch release.
>>
>> Cheers,
>> Bruno.
>>
>> On Tue, Dec 6, 2016 at 5:44 AM Ronny Pfannschmidt <
>> opensource at ronnypfannschmidt.de> wrote:
>>
>> Hi all,
>>
>> i'd like to introduce https://pypi.python.org/pypi/attrs as a
>> dependency,
>>
>> its a fairly usefull library that takes away quite some boilerplate and
>> common error cause while automatically adding repr, comparators and
>> similar small details to python classes.
>>
>> I have used it in a number of personal projects, and dont want to miss
>> it by now.
>>
>> -- Ronny
>> _______________________________________________
>> pytest-dev mailing list
>> pytest-dev at python.org
>> https://mail.python.org/mailman/listinfo/pytest-dev
>>
>> _______________________________________________
>> pytest-dev mailing list
>> pytest-dev at python.org
>> https://mail.python.org/mailman/listinfo/pytest-dev
>>
>>
>>
> _______________________________________________
> pytest-dev mailing list
> pytest-dev at python.org
> https://mail.python.org/mailman/listinfo/pytest-dev
>
>
> _______________________________________________
> pytest-dev mailing list
> pytest-dev at python.org
> https://mail.python.org/mailman/listinfo/pytest-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pytest-dev/attachments/20170624/22c80a2d/attachment.html>


More information about the pytest-dev mailing list