commit a8249fedad606bfd7a0c258734b39500b1aab4fc11b854e3ddab48d3d61cc95d Author: Matej Cepl Date: Mon Apr 28 19:38:28 2025 +0000 - Update to 4.3.1: * Updated bitarray dependency to allow for v3.x. - Update to 4.3.0: * Upgraded bitarray dependency to >= 3.0.0. * Explicit support for Python 3.13. * Added i and I struct codes for 32-bit ints. Bug #340. * Removed the 'experimental feature' label from the new exotic floating point types. * Fix for negative index LSB0 slicing issue. Bug #343. - Update to 4.2.3: * Some codes representing exotic float negative zero converted to positive zero. Bug #333. * Auto-scaling rounding the wrong way on occasion. Bug #334. - Update to 4.2.2: * Sometimes a ValueError was being raised instead of a ReadError. Bug #325. * Initialising a bitstring from None now raises a TypeError rather than generating an empty bitstring. Bug #323. * Fixed performance regression for find/findall in some situations. Bug #326. * Fix for AttributeError bug when combining Bits with BitStream. Bug #329. - Update to 4.2.1: * Module crashes on import with 32-bit Python. Bug #317. * Lists of integers not converted to bytes when using the bytes constructor. Bug #318. * Empty comma separated tokens not handled correctly. Bug #319. * Crash on import when docstrings not present due to optimize flag. Bug #321. - Update to 4.2.0: * Dropped support for Python 3.7. Minimum version is now 3.8. * For tokens that use a non-numeric length, a ':' is now compulsory rather than recommended. For example use 'uint:foo' instead of 'uintfoo'. * The previous e4m3float and e5m2float formats have become the slightly OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-bitstring?expand=0&rev=20 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/bitstring-3.1.9.tar.gz b/bitstring-3.1.9.tar.gz new file mode 100644 index 0000000..b232737 --- /dev/null +++ b/bitstring-3.1.9.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:32da255b20b93a15260a8498170411ef1f112de5e5011fd0ae81fd834edf5f07 +size 408443 diff --git a/bitstring-4.3.1.tar.gz b/bitstring-4.3.1.tar.gz new file mode 100644 index 0000000..7ff6b00 --- /dev/null +++ b/bitstring-4.3.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:49e0fa2d0f174ca1e40711f8b443e6ba2a2e939f13cfefab508bb4ef4257aff3 +size 443834 diff --git a/python-bitstring.changes b/python-bitstring.changes new file mode 100644 index 0000000..177162e --- /dev/null +++ b/python-bitstring.changes @@ -0,0 +1,270 @@ +------------------------------------------------------------------- +Mon Apr 28 13:01:32 UTC 2025 - Felix Stegmeier + +- Update to 4.3.1: + * Updated bitarray dependency to allow for v3.x. + +- Update to 4.3.0: + * Upgraded bitarray dependency to >= 3.0.0. + * Explicit support for Python 3.13. + * Added i and I struct codes for 32-bit ints. Bug #340. + * Removed the 'experimental feature' label from the new exotic floating point + types. + * Fix for negative index LSB0 slicing issue. Bug #343. + +- Update to 4.2.3: + * Some codes representing exotic float negative zero converted to positive + zero. Bug #333. + * Auto-scaling rounding the wrong way on occasion. Bug #334. + +- Update to 4.2.2: + * Sometimes a ValueError was being raised instead of a ReadError. Bug #325. + * Initialising a bitstring from None now raises a TypeError rather than + generating an empty bitstring. Bug #323. + * Fixed performance regression for find/findall in some situations. Bug #326. + * Fix for AttributeError bug when combining Bits with BitStream. Bug #329. + +- Update to 4.2.1: + * Module crashes on import with 32-bit Python. Bug #317. + * Lists of integers not converted to bytes when using the bytes constructor. + Bug #318. + * Empty comma separated tokens not handled correctly. Bug #319. + * Crash on import when docstrings not present due to optimize flag. Bug #321. + +- Update to 4.2.0: + * Dropped support for Python 3.7. Minimum version is now 3.8. + * For tokens that use a non-numeric length, a ':' is now compulsory rather + than recommended. For example use 'uint:foo' instead of 'uintfoo'. + * The previous e4m3float and e5m2float formats have become the slightly + modified p4binary8 and p3binary8 formats. + * Some parameters are now enforced as positional only, such as auto in + constructors. + * The Array class is no longer 'beta'. + * A new Dtype class can be optionally used to specify types. + * The bitstring.options object is now the preferred method for changing + module options. + The bitstring.lsb0 and bitstring.bytealigned variables are now deprecated, + use bitstring.options.lsb0 and bitstring.options.bytealigned instead. + * New fromstring method as another way to create bitstrings from formatted + strings. + Instead of relying on the auto parameter you can now optionally use fromstring. + * More types can now be pretty printed. For example integer and float formats + can be used. + * Pretty printing is now prettier - optional terminal colours added. + * A range of 8-bit, 6-bit and even 4-bit float formats added (beta). + * Performance improvements. + +- Update to 4.1.4: + * 'bytes' token can't be used without explicit length. Bug #303. + +- Update to 4.1.3: + * Removed a couple of files that accidentally got included in the previous + release. Bug #293. + * The 8-bit float formats have been renamed e4m3float and e5m2float. + * Some refactoring and performance optimizations. + +- Update to 4.1.2: + * Fix for the module command-line usage. Bug #290. + * Fix for when creating bitstrings from memoryview objects. + * Renamed the fmt parameter for Arrays to dtype. + * More Array operator coverage. + * Added operators that act on two Arrays of the same size. + * Added comparison operators for Arrays that return an Array of bools. + * Added Array.equals method as == will now return an Array (see above item). + * Added astype() method for Arrays to easily cast to a new dtype. + +- Update to 4.1.1: + * bitarray dependency now pinned to ">=2.8.0, <3.0.0" rather than a specific + version. Bug #283. + * Fix for using numpy integers as integer parameters. Bug #286. + * Removed ability to extend an Array with the + operator. Use the extend + method instead. + * Improvements when pretty-printing the Array. + * Array.count() can now count float('nan') values for floating point types. + +- Update to 4.1.0: + * Speed increased with bitarray dependency + * New Array class for homogeneous data + * Added two new floating point interpretations: float8_143 and float8_152 + * Auto initialization from ints has been removed and now raises a TypeError. + Creating a bitstring from an int still creates a zeroed bitstring of that + length but ints won't be promoted to bitstrings as that has been a constant + source of errors and confusion. + * Explicitly specifying the auto parameter is now disallowed rather than + discouraged. + * Deleting, replacing or inserting into a bitstring resets the bit position + to 0 if the bitstring's length has been changed. Previously the bit position + was adjusted but this was not well-defined + * Only empty bitstring are now considered false in a boolean sense. + * Casting to bytes now behaves as expected, so that bytes(s) gives the same + result as s.tobytes(). Previously it created a byte per bit. + * Pretty printing with the 'bytes' format now uses characters from the + 'Latin Extended-A' unicode block for non-ASCII and unprintable characters + instead of replacing them with '.' + * When using struct-like codes you can now use '=' instead of '@' to signify + native- endianness. They behave identically, but the new '=' is now preferred. + * More fixes for LSB0 mode. + +- Update to 4.0.2: + * Added py.typed file and converted the module to a package to let mypy + find type annotations. Bug 248. + * Fix to shifting operations when using LSB0 mode. Bug 251. + * A few more fixes for LSB0 mode. + * Improved LSB0 documentation. + * Added build-system section to pyproject.toml. Bug 243. + * Rewrote the walkthrough documentation as a jupyter notebook. + * Updated the project's logo. + +- Update to 4.0: + * Minimum supported Python version is now Python 3.7. + * Removed ConstBitArray and BitString class aliases. Use Bits and BitStream + instead. + * The cut() method will now also yield the final bits of a bitstring, even if + they are shorter than the requested cut size. + * Removed default uint interpretation. This wasn't being applied uniformly + the default is now always to return a bitstring object of the given length + and not to interpret it as a uint. Bug 220. + * If an overwrite goes beyond the end of the bitstring it will now extend the + bitstring rather than raise an exception. Bug 148. + * Type hints added throughout the code. + * Underscores are now allowed in strings representing number literals. + * The copy() method now works on Bits as well as BitArray objects. + * The experimental command-line feature is now official. + * New pp() method that pretty-prints the bitstring in various formats - useful + especially in interactive sessions. + * Shorter and more versatile properties. The bin, oct, hex, float, uint and + int properties can now be shortened to just their first letter. They can + also have a length in bits after them - allowing Rust-like data types. + * A colon is no longer required in format strings before a bit length. + * Support for IEEE 16 bit floats. Floating point types can now be 16 bits + long as well as 32 and 64 bits. + * Support for bfloats. This is a specialised 16-bit floating point format + mostly used in machine learning. + +------------------------------------------------------------------- +Sat Jan 15 15:22:21 UTC 2022 - Dirk Müller + +- update to 3.1.9: + * Fixed a couple of outdated results in the readme (Issue 214). + * Some more documentation tidying. + * Turned off some debug code by default. + * Fixed a couple of failing tests in different Python versions. + * Fix for consistent pos initialisation semantics for different types. + * Change to allow wheels to be uploaded to PyPI. + * More work for LSB0 mode, but still not finished or documented (sorry). + +------------------------------------------------------------------- +Thu Sep 17 11:29:36 UTC 2020 - Dirk Mueller + +- update to 3.1.7: + * Fixing del not working correctly when stop value negative (Issue 201) + * Removed deprecated direct import of ABC from collections module (Issue 196) + * Tested and added explicit support for Python 3.7 and 3.8. (Issue 193) + * Fixing a few stale links to documentation. (Issue 194) + * Allowing initialisation with an io.BytesIO object. (Issue 189) + +------------------------------------------------------------------- +Fri Sep 13 11:15:20 UTC 2019 - Tomáš Chvátal + +- Update to 3.1.6: + * Fixed immutability bug. Bug 176. + * Fixed failure of `__contains__` in some circumstances. Bug 180. + * Better handling of open files. Bug 186. + * Better Python 2/3 check. + * Making unit tests easier to run. + * Allowing length of 1 to be specified for bools. (Thanks to LemonPi) + +------------------------------------------------------------------- +Wed Dec 5 01:59:04 UTC 2018 - Jan Engelhardt + +- Use noun phrase in summary. + +------------------------------------------------------------------- +Tue Dec 4 12:46:10 UTC 2018 - Matej Cepl + +- Remove superfluous devel dependency for noarch package + +------------------------------------------------------------------- +Wed Dec 27 13:55:35 UTC 2017 - jengelh@inai.de + +- Trim filler words from description. + +------------------------------------------------------------------- +Wed Oct 18 16:42:21 UTC 2017 - toddrme2178@gmail.com + +- Implement single-spec version + +------------------------------------------------------------------- +Sun Jul 31 15:18:28 UTC 2016 - mardnh@gmx.de + +- Update to version 3.1.5 + * Support initialisation from an array. + * Added a separate LICENSE file. + +- Update to version 3.1.4 + * Fix for bitstring types when created directly from other bitstring types. + * Updating contact, website details. + +- Update to version 3.1.3 + * Fix for problem with prepend for bitstrings with byte offsets in their data store. + +------------------------------------------------------------------- +Sat Apr 20 12:37:23 UTC 2013 - p.drouand@gmail.com + +- Update to version 3.1.2 + + this release has a fix for a problem where unpacked bytes could be + eight times too long. + +------------------------------------------------------------------- +Tue Feb 26 13:12:50 UTC 2013 - p.drouand@gmail.com + +- Update to version 3.1.0: + * New 'pad' token + This token can be used in reads and when packing/unpacking to indicate that + you don't care about the contents of these bits. Any padding bits will just + be skipped over when reading/unpacking or zero-filled when packing. + >>> a, b = s.readlist('pad:5, uint:3, pad:1, uint:3') + Here only two items are returned in the list - the padding bits are ignored. + * New clear and copy convenience methods + These methods have been introduced in Python 3.3 for lists and bytearrays, + as more obvious ways of clearing and copying, and we mirror that change here. + t = s.copy() is equivalent to t = s[:], and s.clear() is equivalent to del s[:]. + * Some bug fixes. + +------------------------------------------------------------------- +Fri Jan 11 14:31:13 UTC 2013 - p.drouand@gmail.com + +- Initial python3 support + +------------------------------------------------------------------- +Fri Jan 11 14:30:45 UTC 2013 - p.drouand@gmail.com + +- Fix wronf EOF and remove shebang on bitstring.py + +------------------------------------------------------------------- +Fri Jan 11 14:14:55 UTC 2013 - p.drouand@gmail.com + +- Update to 3.0.2 version: + * Fix for subclasses of bitstring classes behaving strangely ( Issue 121 ). + * Fix for excessive memory usage in rare cases ( Issue 120 ). + * Fixes for slicing edge cases. + +------------------------------------------------------------------- +Fri Sep 23 13:50:34 UTC 2011 - saschpe@suse.de + +- Update to version 2.2.0: + * Fix for Python 3.2, correcting for a change to the binascii module. + * Fix for bool initialisation from 0 or 1. + * Efficiency improvements, including interning strategy. +- Changes from version 2.1.1: + * Bug fix: Reading using the 'bytes' token had been broken (Issue 102). + * Fixed problem using some methods on ConstBitArrays. + * Better exception handling for tokens missing values. + * Some performance improvements. +- See release_notes.txt for further changes... + +------------------------------------------------------------------- +Fri Mar 19 19:27:25 UTC 2010 - toms@suse.de + +- First initial version 1.3.0 + diff --git a/python-bitstring.spec b/python-bitstring.spec new file mode 100644 index 0000000..48d7593 --- /dev/null +++ b/python-bitstring.spec @@ -0,0 +1,71 @@ +# +# spec file for package python-bitstring +# +# Copyright (c) 2025 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/ +# + + +Name: python-bitstring +Version: 4.3.1 +Release: 0 +Summary: Python module for the construction, analysis and modification of binary data +License: MIT +Group: Development/Languages/Python +URL: https://github.com/scott-griffiths/bitstring +Source: https://github.com/scott-griffiths/bitstring/archive/bitstring-%{version}.tar.gz +BuildRequires: %{python_module pip} +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module wheel} +BuildRequires: fdupes +BuildRequires: python-rpm-macros +BuildArch: noarch +Requires: bitarray +BuildRequires: %{python_module bitarray} +BuildRequires: %{python_module gfloat} +BuildRequires: %{python_module hypothesis} +BuildRequires: %{python_module pytest-benchmark} +%python_subpackages + +%description +Bitstring is a pure Python module to aid +the creation and analysis of binary data. + +Bitstrings can be constructed from integers (big and little endian), hex, +octal, binary, strings or files. They can be sliced, joined, reversed, +inserted into, overwritten, etc. with functions or slice notation. +They can also be read from, searched and replaced, and navigated in, +similar to a file or stream. + +%prep +%autosetup -p1 -n bitstring-bitstring-%{version} +sed -i '1{\@^#!%{_bindir}/env python@d}' bitstring/__init__.py + +%build +%pyproject_wheel + +%install +%pyproject_install +%python_expand %fdupes %{buildroot}%{$python_sitelib} + +%check +%pytest + +%files %{python_files} +%license LICENSE +%doc README.md +%{python_sitelib}/bitstring +%{python_sitelib}/bitstring-4.3.1.dist-info + +%changelog