Name: python-bitmath Summary: Work with file sizes like numbers — convert, compare, sort, and format across any unit prefix Version: 2.0.0.rc2 Release: 1.20260423004003442332.pr121.11.g15409e0%{?dist} License: MIT Source0: bitmath-2.0.0.rc2.tar.gz URL: https://github.com/timlnx/bitmath BuildArch: noarch BuildRequires: python3-devel BuildRequires: pyproject-rpm-macros BuildRequires: python3-hatchling BuildRequires: python3-pytest %description bitmath simplifies many facets of interacting with file sizes in various units. Examples include: converting between SI and NIST prefix units (GiB to kB), converting between units of the same type (SI to SI, or NIST to NIST), basic arithmetic operations (subtracting 42KiB from 50GiB), and rich comparison operations (1024 Bytes == 1KiB), bit-wise operations, sorting, automatic best human-readable prefix selection, and completely customizable formatting. In addition to the conversion and math operations, bitmath provides human readable representations of values which are suitable for use in interactive shells as well as larger scripts and applications. It can also read the capacity of system storage devices. bitmath can parse strings (like "1 KiB") into proper objects and has support for integration with the argparse module as a custom argument type. bitmath ships almost 300 unit tests with near 100% code coverage. ###################################################################### # Sub-package setup %package -n python3-bitmath Summary: Aids representing and manipulating file sizes in various prefix notations %description -n python3-bitmath bitmath simplifies many facets of interacting with file sizes in various units. Examples include: converting between SI and NIST prefix units (GiB to kB), converting between units of the same type (SI to SI, or NIST to NIST), basic arithmetic operations (subtracting 42KiB from 50GiB), and rich comparison operations (1024 Bytes == 1KiB), bit-wise operations, sorting, automatic best human-readable prefix selection, and completely customizable formatting. In addition to the conversion and math operations, bitmath provides human readable representations of values which are suitable for use in interactive shells as well as larger scripts and applications. It can also read the capacity of system storage devices. bitmath can parse strings (like "1 KiB") into proper objects and has support for integration with the argparse module as a custom argument type. bitmath ships almost 300 unit tests with near 100% code coverage. ###################################################################### %generate_buildrequires %pyproject_buildrequires ###################################################################### %prep %setup -n bitmath-2.0.0.rc2 -q ###################################################################### %build %pyproject_wheel ###################################################################### %install %pyproject_install %pyproject_save_files bitmath pushd %{buildroot}%{_bindir} ln -s bitmath bitmath-%{python3_version} popd mkdir -p %{buildroot}%{_mandir}/man1/ cp -v *.1 %{buildroot}%{_mandir}/man1/ ln -s bitmath.1 %{buildroot}%{_mandir}/man1/bitmath-%{python3_version}.1 mkdir -p %{buildroot}%{_docdir}/%{name}/docs cp -v -r docsite/source/* %{buildroot}%{_docdir}/%{name}/docs/ find %{buildroot}%{_docdir}/%{name}/docs -name '.gitkeep' -delete ###################################################################### %check %pytest tests/ ###################################################################### %files %license LICENSE ###################################################################### %files -n python3-bitmath -f %{pyproject_files} %license LICENSE %doc README.rst NEWS.rst %{_bindir}/bitmath %{_bindir}/bitmath-%{python3_version} %{_mandir}/man1/bitmath.1* %{_mandir}/man1/bitmath-%{python3_version}.1* %{_docdir}/%{name}/ ###################################################################### %changelog * Thu Apr 23 2026 Packit - 2.0.0.rc2-1.20260423004003442332.pr121.11.g15409e0 - Last bit wrapping up the python 3.9+ fixup (Tim Case) - Update CLAUDE.md: phases complete, Python 3.9+ minimum, pytest replaces nosetests (Tim Case) - Rename assertListEqual -> assertListEqualUnordered to stop shadowing stdlib (Tim Case) - Add type hints to module-level functions and simple Bitmath methods (Tim Case) - Remove Python 2 unittest2 compat shim from tests/__init__.py (Tim Case) - Also delete the input spec file (Tim Case) - Refreshing more docs (Tim Case) - Refreshing docs (Tim Case) - Claiming library (Tim Case) * Sat Apr 18 2026 Tim Case - 0-1 - Packit-managed changelog. See https://github.com/timlnx/bitmath/releases