Fedora Release Engineering 84201d3
%global pypi_name Pint
f1b5b2f
%bcond_with docs
3c722e9
Fedora Release Engineering 84201d3
Name:           python-pint
f1b5b2f
Version:        0.16.1
cc6f821
Release:        12%{?dist}
Fedora Release Engineering 84201d3
Summary:        Physical quantities module
Fedora Release Engineering 84201d3
Fedora Release Engineering 84201d3
License:        BSD
Fedora Release Engineering 84201d3
URL:            https://github.com/hgrecco/pint
39976c4
Source0:        %pypi_source
bc028d9
Fedora Release Engineering 84201d3
BuildArch:      noarch
60b5b1f
BuildRequires:  pyproject-rpm-macros
Fedora Release Engineering 84201d3
3c722e9
%description
3c722e9
Pint is Python module/package to define, operate and manipulate physical
3c722e9
quantities: the product of a numerical value and a unit of measurement.
3c722e9
It allows arithmetic operations between them and conversions from and
3c722e9
to different units.
3c722e9
3c722e9
It is distributed with a comprehensive list of physical units, prefixes
3c722e9
and constants.
3c722e9
c979544
%package -n python3-pint
3c722e9
Summary:        Physical quantities module
c979544
%{?python_provide:%python_provide python3-pint}
3c722e9
39976c4
BuildRequires:  python3-numpy
39976c4
BuildRequires:  python3-pytest
39976c4
c979544
%description -n python3-pint
3c722e9
Pint is Python module/package to define, operate and manipulate physical
3c722e9
quantities: the product of a numerical value and a unit of measurement.
3c722e9
It allows arithmetic operations between them and conversions from and
3c722e9
to different units.
3c722e9
3c722e9
It is distributed with a comprehensive list of physical units, prefixes
3c722e9
and constants.
3c722e9
f1b5b2f
%if %{with docs}
c979544
%package -n python3-pint-doc
3c722e9
Summary:        Documentation for the pint module
c979544
%{?python_provide:%python_provide python3-pint-doc}
60b5b1f
60b5b1f
BuildRequires:  pandoc
39976c4
BuildRequires:  python3-graphviz
39976c4
BuildRequires:  python3-ipykernel
39976c4
BuildRequires:  python3-jupyter-client
169859e
BuildRequires:  python3-matplotlib
39976c4
BuildRequires:  python3-nbsphinx
f1b5b2f
BuildRequires:  python3-pandas
f1b5b2f
BuildRequires:  python3-dask
f1b5b2f
BuildRequires:  python3-pygments
39976c4
BuildRequires:  python3-sphinx
39976c4
BuildRequires:  python3-xarray
3c722e9
c979544
%description -n python3-pint-doc
3c722e9
Documentation for the pint module
39976c4
%endif
Fedora Release Engineering 84201d3
Fedora Release Engineering 84201d3
%prep
Fedora Release Engineering 84201d3
%setup -q -n %{pypi_name}-%{version}
Fedora Release Engineering 84201d3
83adb07
# numpy 1.24.x removes np.float np.alen and so on
d3cc22f
# These are already fixed upstream
83adb07
grep -rl "dtype=np\.float" . | xargs sed -i -e 's|dtype=np\.float|dtype=float|'
83adb07
sed -i pint/testsuite/test_numpy.py \
83adb07
	-e 's|dtype=float32|dtype=np.float32|' \
83adb07
	-e 's|dtype=float64|dtype=np.float64|' \
83adb07
	-e 's|np\.alen|len|' \
83adb07
	%{nil}
83adb07
d3cc22f
# Workaround for https://github.com/hgrecco/pint/issues/1818
83adb07
sed -i pint/testsuite/__init__.py -e '115s|except TypeError:|except (TypeError, ValueError):|'
83adb07
83adb07
# python 3.12 removes deprecated unittest.assertEquals
d3cc22f
# This is already fixed upstream
83adb07
sed -i pint/testsuite/test_contexts.py -e 's|self.assertEquals|self.assertEqual|'
83adb07
f1b5b2f
# drop numpy version requirement
f1b5b2f
sed -i '/@helpers.requires_numpy_at_least("1.16")/d' pint/testsuite/test_quantity.py
f1b5b2f
60b5b1f
%generate_buildrequires
da0cb64
%pyproject_buildrequires -x test
b85f62c
Fedora Release Engineering 84201d3
%build
60b5b1f
%pyproject_wheel
60b5b1f
f1b5b2f
%if %{with docs}
3c722e9
export PYTHONPATH="$( pwd ):$PYTHONPATH"
3c722e9
sphinx-build-3 docs html
Fedora Release Engineering 84201d3
# remove the sphinx-build leftovers
60b5b1f
Fedora Release Engineering 84201d3
rm -rf html/.{doctrees,buildinfo}
39976c4
%endif
Fedora Release Engineering 84201d3
Fedora Release Engineering 84201d3
%install
60b5b1f
%pyproject_install
Fedora Release Engineering 84201d3
Fedora Release Engineering 84201d3
%check
da0cb64
%pytest
Fedora Release Engineering 84201d3
c979544
%files -n python3-pint
3c722e9
%license LICENSE
39976c4
%{_bindir}/pint-convert
3c722e9
%{python3_sitelib}/pint
60b5b1f
%{python3_sitelib}/Pint-%{version}.*
3c722e9
f1b5b2f
%if %{with docs}
c979544
%files -n python3-pint-doc
3c722e9
%doc html
3c722e9
%license docs/_themes/LICENSE
39976c4
%endif
3c722e9
Fedora Release Engineering 84201d3
%changelog
cc6f821
* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.16.1-12
cc6f821
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
cc6f821
83adb07
* Sun Jul 16 2023 Mamoru TASAKA <mtasaka@fedoraproject.org> - 0.16.1-11
83adb07
- Support numpy 1.24.x some types removal which were already deprecated
83adb07
- Workaround python3.12 changes for Fractions which now returns ValueError
83adb07
  instead of TypeError
83adb07
- Fix for python3.12 with unittest.assertEquals removal
83adb07
684506e
* Tue Jun 27 2023 Python Maint <python-maint@redhat.com> - 0.16.1-10
684506e
- Rebuilt for Python 3.12
684506e
d85f07a
* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.16.1-9
d85f07a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
d85f07a
cfc56f5
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.16.1-8
cfc56f5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
cfc56f5
7168906
* Wed Jun 15 2022 Python Maint <python-maint@redhat.com> - 0.16.1-7
7168906
- Rebuilt for Python 3.11
7168906
b936b37
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.16.1-6
b936b37
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
b936b37
ee8b0fd
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.16.1-5
ee8b0fd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
ee8b0fd
eb667ff
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 0.16.1-4
eb667ff
- Rebuilt for Python 3.10
eb667ff
b20c555
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.16.1-3
b20c555
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
b20c555
f1b5b2f
* Sun Jan 24 2021 Matthias Runge <mrunge@redhat.com> - 0.16.1-2
f1b5b2f
- rebuild without bootstrap
f1b5b2f
- fix FTBFS (rhbz#1914333)
f1b5b2f
da0cb64
* Mon Sep 21 2020 Lumír Balhar <lbalhar@redhat.com> - 0.13-3
da0cb64
- Fix test dependencies and execution
da0cb64
d64a141
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.13-2
d64a141
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
d64a141
39976c4
* Tue Jun 23 2020 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.13-1
39976c4
- Update to 0.13
39976c4
3e4151e
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 0.10.1-3
3e4151e
- Rebuilt for Python 3.9
3e4151e
e0b5185
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.1-2
e0b5185
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
e0b5185
60b5b1f
* Thu Jan 09 2020 Matthias Runge <mrunge@redhat.com> - 0.10.1-1
60b5b1f
- update to 0.10.1 (rhbz#1789066)
60b5b1f
- modernize specfile
60b5b1f
d201d7a
* Thu Sep 05 2019 Matthias Runge <mrunge@redhat.com> - 0.9-5
b85f62c
- skip test_quantity for now (rhbz#1706212)
b85f62c
b89bc15
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 0.9-5
b89bc15
- Rebuilt for Python 3.8
b89bc15
b746efc
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.9-4
b746efc
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
b746efc
bc028d9
* Wed Jul 10 2019 Matthias Runge <mrunge@redhat.com> - 0.9-3
bc028d9
- Use context manager for assertWarns and fix DeprecationWarning
bc028d9
  resolves: rhbz#1706212
bc028d9
b1471f0
* Sun Mar 17 2019 Miro Hrončok <mhroncok@redhat.com> - 0.9-2
b1471f0
- Subpackages python2-pint, python2-pint-doc have been removed
b1471f0
  See https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal
b1471f0
169859e
* Mon Feb 25 2019 Yatin Karel <ykarel@redhat.com> - 0.9-1
169859e
- Update to 0.9
169859e
ce22536
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.6-16
ce22536
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
ce22536
f9edd0d
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.6-15
f9edd0d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
f9edd0d
c41b0ea
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 0.6-14
c41b0ea
- Rebuilt for Python 3.7
c41b0ea
ff9d840
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.6-13
ff9d840
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
ff9d840
7d427a6
* Sat Jan 27 2018 Iryna Shcherbina <ishcherb@redhat.com> - 0.6-12
7d427a6
- Update Python 2 dependency declarations to new packaging standards
7d427a6
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
7d427a6
7faf039
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.6-11
7faf039
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
7faf039
2deec00
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.6-10
2deec00
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
2deec00
0b7cc7c
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 0.6-9
0b7cc7c
- Rebuild for Python 3.6
0b7cc7c
303bb93
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6-8
303bb93
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
303bb93
cafa66b
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.6-7
cafa66b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
cafa66b
16e02af
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6-6
16e02af
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
16e02af
c979544
* Sun Sep 06 2015 Matthias Runge <mrunge@redhat.com> - 0.6-5
c979544
- fix uppercase/lowercase naming, fix obsoletes
c979544
3c722e9
* Fri Sep 04 2015 Chandan Kumar <chkumar246@gmail.com> - 0.6-4
3c722e9
- Add python2 and python3 subpackages
3c722e9
4811217
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6-3
4811217
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
4811217
Fedora Release Engineering 84201d3
* Mon Dec 15 2014 Matthias Runge <mrunge@redhat.com> - 0.6-2
Fedora Release Engineering 84201d3
- change BR python-devel to python2-devel (rhbz#1173109)
Fedora Release Engineering 84201d3
Fedora Release Engineering 84201d3
* Thu Dec 11 2014 Matthias Runge <mrunge@redhat.com> - 0.6-1
Fedora Release Engineering 84201d3
- Initial package.