Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.0 release #219

Merged
merged 32 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
056fc38
remove cases of IS_PY3K in _bitarray.c
ilanschnell Aug 6, 2024
27b4b26
remove cases of IS_PY3K in _util.c
ilanschnell Aug 6, 2024
609d638
remove cases of PY_MAJOR_VERSION
ilanschnell Aug 6, 2024
5cad2f1
remove cases of is_py3k from tests
ilanschnell Aug 6, 2024
dbcc307
remove cases of sys.version_info from test_util.py
ilanschnell Aug 6, 2024
5277725
remove cases of sys.version_info from test_bitarray.py
ilanschnell Aug 6, 2024
6974b4e
remove _is_py2 from util.py
ilanschnell Aug 6, 2024
8e89cb9
update setup.py
ilanschnell Aug 6, 2024
76d2722
simplify
ilanschnell Aug 6, 2024
47cf480
simplify __init__.py and update_doc.py
ilanschnell Aug 6, 2024
1668706
remove util.rindex()
ilanschnell Aug 6, 2024
f67179c
remove util.make_endian()
ilanschnell Aug 6, 2024
c471590
update .pyi-file
ilanschnell Aug 6, 2024
c009930
update changelog
ilanschnell Aug 6, 2024
acaa563
Merge branch 'master' into 3.0release
ilanschnell Oct 6, 2024
eff3766
remove hackish support for handling unpickling, see #207
ilanschnell Oct 6, 2024
90d33f5
remove out-of-date code from puff example
ilanschnell Oct 6, 2024
0766dbb
update make install
ilanschnell Oct 6, 2024
87096bf
remove unused code
ilanschnell Oct 6, 2024
a760801
update readme
ilanschnell Oct 6, 2024
d4c0c42
wording
ilanschnell Oct 7, 2024
4d94dc2
udpate version
ilanschnell Oct 7, 2024
5a8d5c6
remove unused code in example
ilanschnell Oct 7, 2024
6b8e421
.search() now returns iterator - equivalent to .itersearch()
ilanschnell Oct 7, 2024
fe201cc
add test
ilanschnell Oct 7, 2024
eaab4e8
skip test on PyPy
ilanschnell Oct 7, 2024
743472b
update pyi-file
ilanschnell Oct 7, 2024
5aed395
formatting - update example code
ilanschnell Oct 7, 2024
9de22f9
.decode() now returns iterator - equivalent to .iterdecode()
ilanschnell Oct 7, 2024
0446c54
update examples
ilanschnell Oct 7, 2024
c5bd5d7
better naming in core C module
ilanschnell Oct 7, 2024
079011a
remove roadmap - update iter* docstring
ilanschnell Oct 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions CHANGE_LOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
2024-XX-XX 2.9.3:
-------------------
2024-XX-XX 3.0.0:
-------------------
* remove Python 2.7 support
* `.decode()` now returns iterator - equivalent to `.iterdecode()`
* `.search()` now returns iterator - equivalent to `.itersearch()`
* remove `util.rindex()`, use `.index(..., right=1)` instead
* remove `util.make_endian()`, use `bitarray(..., endian=...)` instead
* Remove hackish support for `bitarray()` handling unpickling,
see detailed explaination in #207 - closes #206
* update cibuildwheel to 2.18.0
* bump actions/download-artifact from 2 to 4.1.7, #218
* minor simplifications
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ test: bitarray/_bitarray.so


install:
$(PYTHON) setup.py install
$(PYTHON) -m pip install -vv .


doc: bitarray/_bitarray.so
Expand Down
44 changes: 3 additions & 41 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,6 @@ ability to import and export buffers. This allows creating bitarrays that
are mapped to other objects, including memory-mapped files.


Roadmap
-------

In 2024 (probably around October), we are planning the release of bitarray 3.0.
The 3.0 release will:

* Remove Python 2.7 support.
* Rename ``.itersearch()`` to ``.search()`` and ``.iterdecode()``
to ``.decode()`` (and remove their non-iterator counterpart).
* Remove ``util.rindex()``, use ``.index(..., right=1)`` instead
* Remove ``util.make_endian()``, use ``bitarray(..., endian=...)`` instead
* Remove hackish support for ``bitarray()`` handling unpickling,
see detailed explaination in `#207 <https://github.com/ilanschnell/bitarray/pull/207>`__. This will close `#206 <https://github.com/ilanschnell/bitarray/issues/206>`__.


Key features
------------

Expand Down Expand Up @@ -78,7 +63,7 @@ Once you have installed the package, you may want to test it:

$ python -c 'import bitarray; bitarray.test()'
bitarray is installed in: /Users/ilan/bitarray/bitarray
bitarray version: 2.9.2
bitarray version: 2.9.3
sys.version: 3.10.14 (main, Oct 25 2022) [Clang 16.0.6]
sys.prefix: /Users/ilan/miniforge3
pointer size: 64 bit
Expand All @@ -92,7 +77,7 @@ Once you have installed the package, you may want to test it:
.........................................................................
................................................................
----------------------------------------------------------------------
Ran 502 tests in 0.187s
Ran 491 tests in 0.187s

OK

Expand Down Expand Up @@ -427,7 +412,7 @@ and can therefore be used as a dictionary key:
Reference
=========

bitarray version: 2.9.2 -- `change log <https://github.com/ilanschnell/bitarray/blob/master/doc/changelog.rst>`__
bitarray version: 2.9.3 -- `change log <https://github.com/ilanschnell/bitarray/blob/master/doc/changelog.rst>`__

In the following, ``item`` and ``value`` are usually a single bit -
an integer 0 or 1.
Expand Down Expand Up @@ -771,29 +756,6 @@ This sub-module was added in version 1.2.
New in version 1.8.


``make_endian(bitarray, /, endian)`` -> bitarray
When the endianness of the given bitarray is different from ``endian``,
return a new bitarray, with endianness ``endian`` and the same elements
as the original bitarray.
Otherwise (endianness is already ``endian``) the original bitarray is returned
unchanged.

New in version 1.3.

New in version 2.9: deprecated - use ``bitarray()``.


``rindex(bitarray, sub_bitarray=1, start=0, stop=<end>, /)`` -> int
Return rightmost (highest) index where sub_bitarray (or item - defaults
to 1) is found in bitarray (``a``), such that sub_bitarray is contained
within ``a[start:stop]``.
Raises ``ValueError`` when the sub_bitarray is not present.

New in version 2.3.0: optional start and stop arguments.

New in version 2.9: deprecated - use ``.index(..., right=1)``.


``strip(bitarray, /, mode='right')`` -> bitarray
Return a new bitarray with zeros stripped from left, right or both ends.
Allowed values for mode are the strings: ``left``, ``right``, ``both``
Expand Down
2 changes: 1 addition & 1 deletion bitarray/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def bits2bytes(__n):
Return the number of bytes necessary to store n bits.
"""
import sys
if not isinstance(__n, (int, long) if sys.version_info[0] == 2 else int):
if not isinstance(__n, int):
raise TypeError("integer expected")
if __n < 0:
raise ValueError("non-negative integer expected")
Expand Down
15 changes: 10 additions & 5 deletions bitarray/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,12 @@ class bitarray:
stop: int = ...,
step: int = ...) -> int: ...

def decode(self, code: Union[CodeDict, decodetree]) -> list: ...
def encode(self, code: CodeDict, x: Iterable) -> None: ...
def decode(self,
code: Union[CodeDict, decodetree]) -> Iterator: ...
def iterdecode(self,
code: Union[CodeDict, decodetree]) -> Iterator: ...

def endian(self) -> str: ...
def extend(self, x: Union[str, Iterable[int]]) -> None: ...
def fill(self) -> int: ...
Expand All @@ -62,9 +66,12 @@ class bitarray:

def insert(self, i: int, value: int) -> None: ...
def invert(self, i: int = ...) -> None: ...
def iterdecode(self,
code: Union[CodeDict, decodetree]) -> Iterator: ...

def search(self,
sub_bitarray: Union[bitarray, int],
start: int = ...,
stop: int = ...,
right: int = ...) -> Iterator[int]: ...
def itersearch(self,
sub_bitarray: Union[bitarray, int],
start: int = ...,
Expand All @@ -75,8 +82,6 @@ class bitarray:
def pop(self, i: int = ...) -> int: ...
def remove(self, value: int) -> None: ...
def reverse(self) -> None: ...
def search(self, sub_bitarray: Union[bitarray, int],
limit: int = ...) -> list[int]: ...

def setall(self, value: int) -> None: ...
def sort(self, reverse: int) -> None: ...
Expand Down
Loading