forked from pool/python-bitarray
- Update to 2.3.0 * add optional `buffer` argument to `bitarray()` to import the buffer of another object, #141, #146, see also: [buffer protocol](buffer.rst) * update `.buffer_info()` to include: a read-only flag, an imported buffer flag, and the number of buffer exports * add optional start and stop arguments to `util.rindex()` * add [memory-mapped file](../examples/mmapped-file.py) example * ignore underscore (`_`) in string input, e.g. `bitarray('1100_0111')` * add missing type hinting for new `.bytereverse()` arguments * fix `.extend()` type annotations, #145 * avoid `.reverse()` using temporary memory * make `.unpack()`, `util.serialize()`, `util.vl_encode()` and `.__reduce__()` more memory efficient * add and improve tests - from version 2.2.5 * speedup `find_bit()` and `find_last()` using uint64 checking, this means a speedup for `.find()`, `.index()`, `.search()` and `util.rindex()` * add optional start and stop arguments to `.bytereverse()` * add example to illustrate how [unaligned copying](../examples/copy_n.py) works internally * add documentation * add tests - from version 2.2.4 * use shift operations to speedup all unaligned copy operations, #142 * expose functionality to Python level only in debug mode for testing * add and improve tests - from version 2.2.3 * speedup `repeat()`, #136 * speedup shift operations, #139 * optimize slice assignment with negative step, e.g.: `a[::-1] = 1` OBS-URL: https://build.opensuse.org/request/show/913102 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-bitarray?expand=0&rev=18
72 lines
2.5 KiB
RPMSpec
72 lines
2.5 KiB
RPMSpec
#
|
|
# spec file for package python-bitarray
|
|
#
|
|
# Copyright (c) 2021 SUSE LLC
|
|
#
|
|
# All modifications and additions to the file contributed by third parties
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
# upon. The license for this file, and modifications and additions to the
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
# license for the pristine package is not an Open Source License, in which
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
# published by the Open Source Initiative.
|
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
|
#
|
|
|
|
|
|
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
|
Name: python-bitarray
|
|
Version: 2.3.0
|
|
Release: 0
|
|
Summary: Efficient Arrays of Booleans
|
|
License: Python-2.0
|
|
URL: https://github.com/ilanschnell/bitarray
|
|
Source: https://github.com/ilanschnell/bitarray/archive/%{version}.tar.gz#/bitarray-%{version}.tar.gz
|
|
BuildRequires: %{python_module devel}
|
|
BuildRequires: %{python_module setuptools}
|
|
# SECTION test requirements
|
|
BuildRequires: %{python_module dbm}
|
|
BuildRequires: %{python_module pytest}
|
|
# /SECTION
|
|
BuildRequires: fdupes
|
|
BuildRequires: python-rpm-macros
|
|
%python_subpackages
|
|
|
|
%description
|
|
This module provides an object type which efficiently represents an
|
|
array of booleans. Bitarrays are sequence types and behave very
|
|
much like usual lists. Eight bits are represented by one byte in a
|
|
contiguous block of memory. The user can select between two
|
|
representations; little-endian and big-endian.
|
|
All of the functionality is implemented in C. Methods for accessing
|
|
the machine representation are provided. This can be useful when
|
|
bit level access to binary files is required, such as portable
|
|
bitmap image files (.pbm).
|
|
Also, when dealing with compressed data which uses variable bit
|
|
length encoding, you may find this module useful.
|
|
|
|
%prep
|
|
%setup -q -n bitarray-%{version}
|
|
|
|
%build
|
|
export CFLAGS="%{optflags}"
|
|
%python_build
|
|
|
|
%install
|
|
%python_install
|
|
%python_expand %fdupes %{buildroot}%{$python_sitearch}
|
|
rm examples/growth/.gitignore
|
|
|
|
%check
|
|
# tests don't run from within the source directory
|
|
%python_expand export PYTHONPATH=%{buildroot}%{$python_sitearch}; cd /tmp/; $python -c 'import bitarray; bitarray.test()'
|
|
|
|
%files %{python_files}
|
|
%license LICENSE
|
|
%doc examples CHANGE_LOG README.rst
|
|
%{python_sitearch}/bitarray*
|
|
|
|
%changelog
|