- Add final support for Python 3.13.
- Drop support for Python 3.7.
- Build Windows wheels on GHA.
- Add preliminary support for Python 3.13 as of 3.13a3.
- Drop using
setup_requires
due to constant problems on GHA. - Add support for Python 3.12.
- Build Linux binary wheels for Python 3.11.
- Drop support for Python 2.7, 3.5, 3.6.
- point release to rebuild full set of wheels
- Add support for building arm64 wheels on macOS.
- Fix macOS wheel build issues on GitHub Actions
- We no longer provide 32bit wheels for the Windows platform, only x86_64.
- Add support for Python 3.11.
- Disable unsafe math optimizations in C code. (#184)
- Add support for Python 3.10.
- Fix
fsBTree.TreeSet
andfsBTree.BTree
raisingSystemError
. See issue 170. - Fix all the
fsBTree
objects to provide the correct interfaces and be instances of the appropriate collection ABCs. This was done for the other modules in release 4.8.0. - Fix the
multiunion
,union
,intersection
, anddifference
functions when used with arbitrary iterables. Previously, the iterable had to be pre-sorted, meaning only sequences likelist
andtuple
could reliably be used; this was not documented though. If the iterable wasn't sorted, the function would produce garbage output. Now, if the function detects an arbitrary iterable, it automatically sorts a copy.
- Fix setting unknown class attributes on subclasses of BTrees when
using the C extension. This prevented subclasses from being
decorated with
@component.adapter()
. See issue 168.
- Fix the C implementation to match the Python implementation and
allow setting custom node sizes for an entire application directly
by changing
BTree.max_leaf_size
andBTree.max_internal_size
attributes, without having to create a new subclass. These attributes can now also be read from the classes in the C implementation. See issue 166. - Add various small performance improvements for storing
zope.interface attributes on
BTree
andTreeSet
as well as deactivating persistent objects from this package.
- Make Python 2 forbid the use of type objects as keys (unless a custom metaclass is used that implements comparison as required by BTrees.) On Python 3, types are not orderable so they were already forbidden, but on Python 2 types can be ordered by memory address, which makes them unsuitable for use as keys. See issue.
- Make the
multiunion
,union
,intersection
, anddifference
functions accept arbitrary Python iterables (that iterate across the correct types). Previously, the Python implementation allowed this, but the C implementation only allowed objects (likeTreeSet
orBucket
) defined in the same module providing the function. See issue 24. - Fix persistency bug in the Python version (#118).
- Fix
Tree.__setstate__
to no longer accept children besides tree or bucket types to prevent crashes. See PR 143 for details. - Make BTrees, TreeSet, Set and Buckets implements the
__and__
,__or__
and__sub__
special methods as shortcuts forBTrees.Interfaces.IMerge.intersection
,BTrees.Interfaces.IMerge.union
andBTrees.Interfaces.IMerge.difference
. - Add support for Python 3.9.
- Build and upload aarch64 wheels.
- Make a value of
0
in thePURE_PYTHON
environment variable require the C extensions (except on PyPy). Previously, and if this variable is unset, missing or unusable C extensions would be silently ignored. With this variable set to0
, anImportError
will be raised if the C extensions are unavailable. See issue 156. - Make the BTree objects (
BTree
,TreeSet
,Set
,Bucket
) of each module actually provide the interfaces defined inBTrees.Interfaces
. Previously, they provided no interfaces. - Make all the BTree and Bucket objects instances of
collections.abc.MutableMapping
(that is,isinstance(btree, MutableMapping)
is now true; no actual inheritance has changed). As part of this, they now provide thepopitem()
method. - Make all the TreeSet and Set objects instances of
collections.abc.MutableSet
(that is,isinstance(tree_set, MutableSet)
is now true; no actual inheritance has changed). As part of this, they now provide several more methods, includingisdisjoint
,discard
, andpop
, and support in-place mutation operators such astree_set |= other
,tree_set += other
,tree_set -= other
andtree_set ^= other
. See issue 121. - Update the definitions of
ISized
andIReadSequence
to simply bezope.interface.common.collections.ISized
andzope.interface.common.sequence.IMinimalSequence
respectively. - Remove the
__nonzero__
interface method fromICollection
. No objects actually implemented such a method; instead, the boolean value is typically taken from__len__
. - Adjust the definition of
ISet
to produce the same resolution order under the C3 and legacy orderings. This means that the legacy order has changed slightly, but that this package emits no warnings whenZOPE_INTERFACE_LOG_CHANGED_IRO=1
. Note that the legacy order was not being used for these objects because the C3 ordering was still consistent; it could only be obtained usingZOPE_INTERFACE_USE_LEGACY_IRO=1
. See PR 159 for all the interface updates. - Fix the
get
,setdefault
andpop
methods, as well as thein
operator, to not suppressPOSKeyError
if the object or subobjects are corrupted. Previously, such errors were logged by ZODB, but not propagated. See issue 161.
Fix more cases of C and Python inconsistency. The C implementation now behaves like the Python implementation when it comes to integer overflow for the integer keys for
in
,get
andhas_key
. Now they return False, the default value, and False, respectively in both versions if the tested value would overflow or underflow. Previously, the C implementation would raiseOverflowError
orKeyError
, while the Python implementation functioned as expected. See issue 140.Note
The unspecified true return values of
has_key
have changed.
- Fix the definitions of
__all__
in modules. In 4.7.0, they incorrectly left out names. See PR 132. - Ensure the interface resolution order of all objects is consistent. See issue 137.
- Add unsigned variants of the trees. These use the initial "U" for
32-bit data and "Q" for 64-bit data (for "quad", which is similar to
what the C
printf
function uses and the Python struct module uses). - Fix the value for
BTrees.OIBTree.using64bits
when using the pure Python implementation (PyPy and whenPURE_PYTHON
is in the environment). - Make the errors that are raised when values are out of range more consistent between Python 2 and Python 3 and between 32-bit and 64-bit variants.
- Make the Bucket types consistent with the BTree types as updated in
versions 4.3.2: Querying for keys with default comparisons or that
are not integers no longer raises
TypeError
.
- Add support for Python 3.8.
- Drop support for Python 3.4.
- Fix tests against persistent 4.4.
- Stop accidentally installing the 'terryfy' package in macOS wheels. See issue 98.
- Fix segmentation fault in
bucket_repr()
. See issue 106.
- Produce binary wheels for Python 3.7.
- Use pyproject.toml to specify build dependencies. This requires pip 18 or later to build from source.
- Add support for Python 3.6 and 3.7.
- Drop support for Python 3.3.
- Raise an
ImportError
consistently on Python 3 if the C extension for BTrees is used but thepersistent
C extension is not available. Previously this could result in an oddAttributeError
. See zopefoundation#55 - Fix the possibility of a rare crash in the C extension when deallocating items. See zopefoundation#75
- Respect the
PURE_PYTHON
environment variable at runtime even if the C extensions are available. See zopefoundation#78 - Always attempt to build the C extensions, but make their success optional.
- Fix a
DeprecationWarning
that could come from I and L objects in Python 2 in pure-Python mode. See zopefoundation#79
Fixed a packaging bug that caused extra files to be included (some of which caused problems in some platforms).
Allow None as a special key (sorted smaller than all others).
This is a bit of a return to BTrees 3 behavior in that Nones are allowed as keys again. Other objects with default ordering are still not allowed as keys.
Make the CPython implementation consistent with the pure-Python implementation and only check object keys for default comparison when setting keys. In Python 2 this makes it possible to remove keys that were added using a less restrictive version of BTrees. (In Python 3 keys that are unorderable still cannot be removed.) Likewise, all versions can unpickle trees that already had such keys. See: zopefoundation#53 and zopefoundation#51
Make the Python implementation consistent with the CPython implementation and check object key identity before checking equality and performing comparisons. This can allow fixing trees that have keys that now have broken comparison functions. See zopefoundation#50
Make the CPython implementation consistent with the pure-Python implementation and no longer raise
TypeError
for an object key (in object-keyed trees) with default comparison on__getitem__
,get
orin
operations. Instead, the results will be aKeyError
, the default value, andFalse
, respectively. Previously, CPython raised aTypeError
in those cases, while the Python implementation behaved as specified.Likewise, non-integer keys in integer-keyed trees will raise
KeyError
, return the default and returnFalse
, respectively, in both implementations. Previously, pure-Python raised aKeyError
, returned the default, and raised aTypeError
, while CPython raisedTypeError
in all three cases.
- Packaging: fix password used to automate wheel creation on Travis.
- Fix unexpected
OverflowError
when passing 64bit values to long keys / values on Win64. See: zopefoundation#32 - When testing
PURE_PYTHON
environments undertox
, avoid poisoning the user's global wheel cache. - Ensure that the pure-Python implementation, used on PyPy and when a C compiler isn't available for CPython, pickles identically to the C version. Unpickling will choose the best available implementation. This change prevents interoperability problems and database corruption if both implementations are in use. While it is no longer possible to pickle a Python implementation and have it unpickle to the Python implementation if the C implementation is available, existing Python pickles will still unpickle to the Python implementation (until pickled again). See: zopefoundation#19
- Avoid creating invalid objects when unpickling empty BTrees in a pure-Python environment.
- Drop support for Python 2.6 and 3.2.
- Add support for Python 3.5.
- Ensure that pure-Python Bucket and Set objects have a human readable
__repr__
like the C versions.
- Fix
_p_changed
when removing items from small pure-Python BTrees/TreeSets and when adding items to small pure-Python Sets. See: zopefoundation#13
- Suppress testing 64-bit values in OLBTrees on 32 bit machines. See: zopefoundation#9
- Fix
_p_changed
when adding items to small pure-Python BTrees/TreeSets. See: zopefoundation#11
- Accomodate long values in pure-Python OLBTrees.
- Add support for PyPy and PyPy3.
- Add support for Python 3.4.
- BTree subclasses can define
max_leaf_size
ormax_internal_size
to control maximum sizes for Bucket/Set and BTree/TreeSet nodes. - Detect integer overflow on 32-bit machines correctly under Python 3.
- Update pure-Python and C trees / sets to accept explicit None to indicate
max / min value for
minKey
,maxKey
. (PR #3) - Update pure-Python trees / sets to accept explicit None to indicate
open ranges for
keys
,values
,items
. (PR #3)
- Fix value-based comparison for objects under Py3k: addresses invalid
merges of
[OLI]OBTrees/OBuckets
. - Ensure that pure-Python implementation of
OOBTree.byValue
matches semantics (reversed-sort) of C implementation.
- Issue #2: compilation error on 32-bit mode of OS/X.
- Test
PURE_PYTHON
environment variable support: if set, the C extensions will not be built, imported, or tested.
- Changed the
ZODB
extra to require only the realZODB
package, rather than theZODB3
metapackage: depending on the version used, the metapackage could pull in stale versions of this package andpersistent
. - Fixed Python version check in
setup.py
.
- Fit the
repr
of bucket objects, which could contain garbage characters.
- Emulate the (private) iterators used by the C extension modules from
pure Python. This change is "cosmetic" only: it prevents the ZCML
zope.app.security:permission.zcml
from failing. The emulated classes are not functional, and should be considered implementation details. - Accomodate buildout to the fact that we no longer bundle a copy of 'persistent.h'.
- Fix test failures on Windows: no longer rely on overflows from
sys.maxint
.
- Added
setup_requires==['persistent']
.
- Updated Trove classifiers.
- Added explicit support for Python 3.2, Python 3.3, and PyPy. Note that the C extensions are not (yet) available on PyPy.
- Python reference implementations now tested separately from the C verions on all platforms.
- 100% unit test coverage.
- Provide local fallback for persistent C header inclusion if the persistent distribution isn't installed. This makes the winbot happy.
- Dropped support for Python < 2.6.
- Factored
BTrees
as a separate distribution.
- All covered platforms tested under
tox
. - Added support for continuous integration using
tox
andjenkins
. - Added
setup.py dev
alias (installsnose
andcoverage
). - Dropped dependency on
zope.testing
/zope.testrunner
: tests now run withsetup.py test
.
- Added API reference, generated via Spinx' autodoc.
- Added Sphinx documentation based on ZODB Guide (snippets are exercised via 'tox').
- Added
setup.py docs
alias (installsSphinx
andrepoze.sphinx.autointerface
).