14
0
Files
python-bitarray/python-bitarray.spec
Steve Kowalik 584e1bd76e - Update to 1.5.2:
* add PyType_Ready usage, issue #66
  * speedup search() for bitarrays with length 1 in sparse bitarrays,
    see issue #67
  * add tests
  * support signed integers in `util.ba2int()` and `util.int2ba()`,
    see issue #85
  * deprecate `.length()` in favor of `len()`
  * Use `Py_ssize_t` for bitarray index.  This means that on 32bit
    systems, the maximun number of elements in a bitarray is 2 GBits.
    We used to have a special 64bit index type for all architectures, but
    this prevented us from using Python's sequence, mapping and number
    methods, and made those method lookups slow.
  * speedup slice operations when step size = 1 (if alignment allows
    copying whole bytes)
  * Require equal endianness for operations: `&`, `|`, `^`, `&=`, `|=`, `^=`.
    This should have always been the case but was overlooked in the past.
  * raise TypeError when tring to create bitarray from boolean
  * This will be last release to still support Python 2.6 (which was retired
    in 2013).  We do NOT plan to stop support for Python 2.7 anytime soon.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-bitarray?expand=0&rev=7
2020-08-31 05:04:02 +00:00

70 lines
2.4 KiB
RPMSpec

#
# spec file for package python-bitarray
#
# Copyright (c) 2020 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: 1.5.2
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}
# /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}
%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 AUTHORS CHANGE_LOG README.md TODO
%{python_sitearch}/bitarray*
%changelog