%global _empty_manifest_terminate_build 0
%global module_name     quantities
%global _description\
Quantities is designed to handle arithmetic and conversions of physical\
quantities, which have a magnitude, dimensionality specified by various units,\
and possibly an uncertainty. See the tutorial for examples. Quantities builds\
on the popular numpy library and is designed to work with numpy ufuncs, many of\
which are already supported. Quantities is actively developed, and while the\
current features and API are stable, test coverage is incomplete so the package\
is not suggested for mission-critical applications.

Name:		python-quantities
Version:	0.16.4
Release:	1
Summary:	Support for physical quantities with units, based on numpy
License:	BSD
URL:		https://github.com/python-quantities/python-quantities
Source0:	https://files.pythonhosted.org/packages/source/q/quantities/quantities-%{version}.tar.gz
Patch0:		modify-setup.patch
BuildArch:	noarch

%description
%_description

%package -n python3-quantities
Summary:	Support for physical quantities with units, based on numpy
Provides:	python-quantities = %{version}-%{release}
BuildRequires:	python3-devel
BuildRequires:	python3-setuptools
BuildRequires:	python3-numpy
BuildRequires:	python3-pytest
BuildRequires:	python3-wheel
Requires:	python3-numpy
%description -n python3-quantities
%_description

%package help
Summary:	Development documents and examples for quantities
Provides:	python3-quantities-doc
%description help
%_description

%prep
%autosetup -n quantities-%{version}

%build
%py3_build

%install
%py3_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
if [ -f README.rst ]; then cp -af README.rst %{buildroot}/%{_pkgdocdir}; fi
if [ -f README.md ]; then cp -af README.md %{buildroot}/%{_pkgdocdir}; fi
if [ -f README.txt ]; then cp -af README.txt %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
	find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
	find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
	find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
	find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
	find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .

%check
%{__python3} -m pytest -v

%files -n python3-quantities -f filelist.lst
%doc CHANGES.txt doc/user/license.rst
%dir %{python3_sitelib}/*

%files help -f doclist.lst
%{_docdir}/*

%changelog
* Mon Jan 19 2026 yyli <dev01209@linx-info.com> - 0.16.4-1
- Update package to version 0.16.4
- Fix problems with v0.16.3: deepcopy was not copying all necessary attributes of UnitQuantity; in-place arithmetic didn't handle multiplying by scalars
- Fix broken `deepcopy` behaviour when using quantities with NumPy 2.x
- Fixes for assorted breakages that appear with recent NumPy versions
- Revert to previous behaviour where spaces around units were allowed
- Fix broken in-place arithmetic when using quantities with NumPy 2.x
- Add CI testing for Python 3.13 and 3.14, drop support for Python 3.9
- Add CI testing for NumPy versions 2.1 to 2.4, drop support for NumPy 1.22 and 1.23.

* Tue Oct 21 2025 liyue <liyue01@kylinos.cn> - 0.16.2-1
- Update package to version 0.16.2
- Added a property `dimensionless_magnitude` to the Quantity class
- Implemented an alternative approach to avoiding arbitrary evaluation of code when parsing strings as units, which fixes some bugs introduced in v0.16.1
- Added the kilonewton

* Fri Nov 1 2024 wanggang <wanggang1@kylinos.cn> - 0.16.1-1
- Update package to version 0.16.1
- Fixed a couple of small bugs ([`PR#238 <https://github.com/python-quantities/python-quantities/pull/238>`_] and [`PR#242 <https://github.com/python-quantities/python-quantities/pull/242>`_])
- Added umath funcs: `maximum` & `minimum`
- Added support for NumPy 2.0, while maintaining support for older versions back to 1.22 [`PR#235 <https://github.com/python-quantities/python-quantities/pull/235>`_]. Many thanks to Björn Dahlgren and Zach McKenzie for this.
- Fixed a potential security hole [`PR#236 <https://github.com/python-quantities/python-quantities/pull/236>`_]
- Dropped support for Python 3.8

* Tue Apr 02 2024 zhaojingyu <zhaojingyu@kylinos.cn> - 0.15.0-1
- Update package to version 0.15.0
- Dropped support for NumPy 1.19, added testing for Numpy 1.25 and 1.26, and for Python 3.12

* Mon Feb 27 2023 wangjunqi <wangjunqi@kylinos.cn> - 0.14.1-1
- Update package to version 0.14.1

* Wed Aug 03 2022 fushanqing <fushanqing@kylinos.cn> - 0.13.0-1
- update to 0.13.0

* Fri Jul 30 2021 chenyanpanHW <chenyanpan@huawei.com> - 0.12.3-2
- DESC: delete -S git from %autosetup, and delete BuildRequires git-core

* Tue Jul 06 2021 duyiwei<duyiwei@kylinos.cn> - 0.12.3-1
- Init package