pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/devel/py-attrs Changes 17.1.0:



details:   https://anonhg.NetBSD.org/pkgsrc/rev/9992664e0037
branches:  trunk
changeset: 362624:9992664e0037
user:      adam <adam%pkgsrc.org@localhost>
date:      Sat May 20 06:01:46 2017 +0000

description:
Changes 17.1.0:
Backward-incompatible changes:
* attrs will set the __hash__() method to None by default now. The way hashes were handled before was in conflict with Python?s specification. This may break some software although this breakage is 
most likely just surfacing of latent bugs. You can always make attrs create the __hash__() method using @attr.s(hash=True).
* Correspondingly, attr.ib?s hash argument is None by default too and mirrors the cmp argument as it should.

Deprecations:
* attr.assoc() is now deprecated in favor of attr.evolve() and will stop working in 2018.

Changes:
Fix default hashing behavior. Now hash mirrors the value of cmp and classes are unhashable by default.
Added attr.evolve() that, given an instance of an attrs class and field changes as keyword arguments, will instantiate a copy of the given instance with the changes applied. evolve() replaces 
assoc(), which is now deprecated. evolve() is significantly faster than assoc(), and requires the class have an initializer that can take the field values as keyword arguments (like attrs itself can 
generate).
FrozenInstanceError is now raised when trying to delete an attribute from a frozen class.
Frozen-ness of classes is now inherited.
__attrs_post_init__() is now run if validation is disabled.
Added attr.validators.in_(options) that, given the allowed options, checks whether the attribute value is in it. This can be used to check constants, enums, mappings, etc.
Added attr.validators.and_() that composes multiple validators into one.
For convenience, the validator argument of @attr.s now can take a list of validators that are wrapped using and_().
Accordingly, attr.validators.optional() now can take a list of validators too.
Validators can now be defined conveniently inline by using the attribute as a decorator. Check out the examples to see it in action!
attr.Factory() now has a takes_self argument that makes the initializer to pass the partially initialized instance into the factory. In other words you can define attribute defaults based on other 
attributes.
Default factories can now also be defined inline using decorators. They are always passed the partially initialized instance.
Conversion can now be made optional using attr.converters.optional().
attr.make_class() now accepts the keyword argument bases which allows for subclassing.
Metaclasses are now preserved with slots=True.

diffstat:

 devel/py-attrs/Makefile |   6 +++---
 devel/py-attrs/PLIST    |   5 ++++-
 devel/py-attrs/distinfo |  10 +++++-----
 3 files changed, 12 insertions(+), 9 deletions(-)

diffs (53 lines):

diff -r 3344e573a2d7 -r 9992664e0037 devel/py-attrs/Makefile
--- a/devel/py-attrs/Makefile   Sat May 20 05:40:35 2017 +0000
+++ b/devel/py-attrs/Makefile   Sat May 20 06:01:46 2017 +0000
@@ -1,12 +1,12 @@
-# $NetBSD: Makefile,v 1.3 2017/02/13 18:57:05 adam Exp $
+# $NetBSD: Makefile,v 1.4 2017/05/20 06:01:46 adam Exp $
 
-DISTNAME=      attrs-16.3.0
+DISTNAME=      attrs-17.1.0
 PKGNAME=       ${PYPKGPREFIX}-${DISTNAME}
 CATEGORIES=    devel
 MASTER_SITES=  ${MASTER_SITE_PYPI:=a/attrs/}
 
 MAINTAINER=    pkgsrc-users%NetBSD.org@localhost
-HOMEPAGE=      https://attrs.readthedocs.org/
+HOMEPAGE=      https://www.attrs.org/
 COMMENT=       Attributes without boilerplate
 LICENSE=       mit
 
diff -r 3344e573a2d7 -r 9992664e0037 devel/py-attrs/PLIST
--- a/devel/py-attrs/PLIST      Sat May 20 05:40:35 2017 +0000
+++ b/devel/py-attrs/PLIST      Sat May 20 06:01:46 2017 +0000
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.2 2017/02/13 18:57:05 adam Exp $
+@comment $NetBSD: PLIST,v 1.3 2017/05/20 06:01:46 adam Exp $
 ${PYSITELIB}/${EGG_INFODIR}/PKG-INFO
 ${PYSITELIB}/${EGG_INFODIR}/SOURCES.txt
 ${PYSITELIB}/${EGG_INFODIR}/dependency_links.txt
@@ -19,6 +19,9 @@
 ${PYSITELIB}/attr/_make.py
 ${PYSITELIB}/attr/_make.pyc
 ${PYSITELIB}/attr/_make.pyo
+${PYSITELIB}/attr/converters.py
+${PYSITELIB}/attr/converters.pyc
+${PYSITELIB}/attr/converters.pyo
 ${PYSITELIB}/attr/exceptions.py
 ${PYSITELIB}/attr/exceptions.pyc
 ${PYSITELIB}/attr/exceptions.pyo
diff -r 3344e573a2d7 -r 9992664e0037 devel/py-attrs/distinfo
--- a/devel/py-attrs/distinfo   Sat May 20 05:40:35 2017 +0000
+++ b/devel/py-attrs/distinfo   Sat May 20 06:01:46 2017 +0000
@@ -1,6 +1,6 @@
-$NetBSD: distinfo,v 1.2 2017/02/13 18:57:05 adam Exp $
+$NetBSD: distinfo,v 1.3 2017/05/20 06:01:46 adam Exp $
 
-SHA1 (attrs-16.3.0.tar.gz) = ce3d6456b024a21cc20291d605964dbcff205e64
-RMD160 (attrs-16.3.0.tar.gz) = 89b7aa7b8ffe2463faf83520d596c88c49af5ebd
-SHA512 (attrs-16.3.0.tar.gz) = 1a91e6f27ecaf20c409c3abf88ffed5c6cfdbba8cff44637399b713271ff838a054f5859dd29440b2780d81b40673033e3f8e43dd491bece72e0a4f08c4ef688
-Size (attrs-16.3.0.tar.gz) = 57512 bytes
+SHA1 (attrs-17.1.0.tar.gz) = d856db735ebcf3111dae408d2b69afc7d97ff119
+RMD160 (attrs-17.1.0.tar.gz) = 80e50902d23de6bffc96ffdc123f7a2c5f4a44ba
+SHA512 (attrs-17.1.0.tar.gz) = 5d902dfefdcfdc693931e0600833d3bc412d26026fda8691cc8f2652b4e872dfd17ac600a463c11152df11db1c9bbf6e598360d1ead50d9ebf5bae4124921517
+Size (attrs-17.1.0.tar.gz) = 76069 bytes



Home | Main Index | Thread Index | Old Index