2.2.0 - autoclass enhancements¶
@autoclassnow provides an
autofieldsargument to apply
pyfields.autofieldsautomatically before applying autoclass. Fixes #38
@autoclassnow removes private fields from the generated autodict representation by default. Fixes #37
2.1.5 - python 2 packaging improvements¶
- setup improvements: set the universal wheel flag to 1, and cleaned up the setup.py. Fixes #36
2.1.4 - Packaging improvements¶
setup.pyimprovements: now including
testsfolder, and using
2.1.3 - Fixed DeprecationWarning¶
- Fixed DeprecationWarning. Fixed #35
2.1.2 - bugfix¶
Fixed bug happening when
pyfields is not installed. Fixed #33.
- Added independent
@autoeq, supported in
@autoclassand automatically activated when
autodict=False. Fixed #32.
False: now property names are correctly used instead of the private names.
__eq__method: when the other object is a dictionary a direct comparison is now done before trying super.
pyfields support + major refactoring¶
default string representation in
@autodictis now more readable. Legacy representation is still available through a parameter. Fixed #29.
pyfieldscan now be used as the source for the list of attributes, in
@autoclass. Fixes #28
@autoreprdecorator. Previously this feature was only available through
@autodict, it can now be used without it.
autorepris supported in
@autoclass, and if users set
autodict=Falseby default it will be enabled. Fixed Fixed #30 and #31.
Misc / bugfixes
Major refactoring: more readable and maintainable code.
@autodictbehaviour when the list was
vars(self)and used together with
@autoprops: with some options the private names were appearing and with others the public property names were appearing. Now the public property names always appear if they exist.
@autoslots feature, that can also be used from
@autoclass by setting
(autoslots=True). Fixes #9
1.17.2 - Added
__version__ attribute at package level.
1.17.1 - Fixed bug with latest
ValidationErrorhappening in all use cases. Fixed #25.
1.17.0 - Fixed
exclude behaviour concerning property attributes¶
- Names used in
excludeare now correctly taken into account by
autohasheven if the names correspond to property names and therefore the actual attributes names start with an underscore. Fixes #21
1.16.0 - Python 2 support¶
- This library now works on python 2.7, 3.5, 3.6 and 3.7. Fixes #3.
1.15.1 - fixed valid8 exception message¶
- Fixed #24
1.15.0 - more tolerance for inherited constructors¶
autopropsnow tolerate inherited constructors
1.14.0 - submodule name changes¶
- The submodule names were conflicting with the variable names: renamed them all
- The init file has been improved so as not to export symbols from other packages. Fixes #23
1.13.0 - @autodict_override¶
- New annotation
@autodict_overridethat you can use to override
__len__. Fixes #22
1.12.0 - autodict fix¶
- In case of inheritance, the order of attributes in now better and reproductible. Fixes #20
- Printed representation created by @autodict now uses the same order than the generated keys iterator on the dictionary-faceted object.
1.11.0 - autodict fixes¶
@autodictdoes not add the
from_dictclass method anymore if this method already exists. If it does not already exist however, it is now always created (even if
- inheritance is now handled more correctly (not perfect but it seems to handle more cases) with
@autodict. Fixes #19
1.10.2 - minor bugfix¶
- Fixed #18
1.10.1 - compatibility¶
- Now compliant with old versions of
typing.Typeis not imported explicitly anymore.
- tests updated with latest version of
1.10.0 - bugfixes and updated doc¶
- Updated documentation main page
@autoargsbehaviour wrt keyword arguments changed. See usage page for details.
excludeparameters now support any kind of sequence, in all decorators
- Bugfix: Setter is called twice for default values
- Bugfix: @autoprops argument name in setter is not correct
1.9.2 - added autohash + fix¶
- new annotation
- The equality method
@autodictis now correct
@autodict: fixed consistency with default values of
only_public_fields: it was False when using the individual decorator, but True when using @autoclass global decorator or the manual decoration method. Now it is True everywhere.
1.9.1 - a few fixes¶
- Now compliant with valid8 2.0.0
- Fixed #13: now generated setters have default values when it was the case on the constructor.
1.9.0 - valid8 is now an independent project¶
validate_decorateand all validators have been moved to an independent project, thus decoupling
autoclassfrom the choice of validator library.
1.8.1 - minor improvements¶
- Now detecting conflicts with
enforcewhen annotations are not in the right order (see #12)
- Added tests for
on_all_and fixed corresponding bugs.
1.8.0 - new validators for collections¶
1.7.1 - bug fix: lts validator¶
ltswas erroneously mappend onto
gt. Fixed this.
1.7.0 - @autoclass¶
- New decorator
@autoclassto apply several features at once.
@autodictnow also generates a
from_dictstatic method in the class, as well as
__eq__if not present
1.6.0 - @autodict¶
- New decorator
@autodictto make a class behave like a (read-only) dict. So this is a 'dict view' on top of an object, basically the opposite of
munch(that is an 'object view' on top of a dict)
1.5.0 - Robustness and minor improvements¶
- better error messages for set enforcers
- uniform management of validators lists: now passing a list creates an 'and_' operator behind the scenes
- better handling of empty lists
- and, or, xor now automatically replace themselves with their contents when their contents is a single validator
- added a few tests to improve coverage (hopefully)
1.4.3 - User-friendly validators error messages¶
- better validation error messages for parametrized validators
1.4.2 - Improved and documented validators¶
- improved validators list documentation
- added new validator:
- fixed bugs in
xor_: since custom validators may now throw exceptions other than
ValidationErrorand may return
None, there was a need to update them to take these cases into account
not_may now be applied to a list of validators (implicit
- more unit tests for boolean validators
1.4.1 - Improved and documented validation feature¶
- A validator function may now return
- improved documentation on
@validatein particular for custom validators implementation
1.4.0 - Added validation feature¶
@validateannotation allowing to implement input validation. Comes with a bunch of built-in validators.
1.3.1 - Documentation and Travis integration 2¶
- Improved documentation
- Automatic test report generation in travis
- Automatic PyPI deployment on tags in travis
1.3.0 - Project renaming¶
classtools-autocodeProject was renamed
- Travis configuration was updated accordingly
1.2.0 - Performance and documentation¶
- improved examples in the documentation
- improved performance of var_checker (lessons learnt from parsyfiles)
1.1.0 - Mkdocs and enforce¶
- now using mkdocs to generate the documentation from markdown
@autoprops: generated getters and setters now have correct PEP484 signature, which makes the library compliant with
- updated documentation accordingly