Files
python-pint/python-pint.spec
2026-03-02 18:10:00 +08:00

76 lines
2.0 KiB
RPMSpec
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
%bcond xarray 1
# Not yet packaged: python-uncertainties
%bcond uncertainties 0
# Requires babel <= 2.8; F42 has 2.16.0
%bcond babel 0
# Not yet packaged: python-pint-pandas
%bcond pandas 0
# Not yet packaged: python-mip
%bcond mip 0
# Requires dask < 2025.3.0 but F43 and Rawhide are at 2025.9.1
# See: https://github.com/dask/dask-ml/issues/1016
%bcond dask 0
Name: python-pint
Version: 0.25.2
Release: %autorelease
Summary: Physical quantities module
License: BSD-3-Clause
URL: https://github.com/hgrecco/pint
Source: %{pypi_source pint}
BuildArch: noarch
# To manipulate pyproject.toml
BuildRequires: tomcli
%global _description %{expand:
Pint is a Python package to define, operate and manipulate physical quantities:
the product of a numerical value and a unit of measurement. It allows
arithmetic operations between them and conversions from and to different units.
It is distributed with a comprehensive list of physical units, prefixes and
constants.}
%description %{_description}
%package -n python3-pint
Summary: %{summary}
%description -n python3-pint %{_description}
%prep
%autosetup -n pint-%{version} -p1
# https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_linters
tomcli set pyproject.toml lists delitem project.optional-dependencies.test \
pytest-cov
# This module is executable in the source, and it might make sense for upstream
# to run it directly as a script during development, but this package will
# install it in site-packages without the executable bit set, so it doesnt
# make sense for it to have a shebang. Package users will run it via the
# generated pint-convert entry point instead.
sed -r -i '1{/^#!/d}' pint/pint_convert.py
%generate_buildrequires
%{pyproject_buildrequires}
%build
%pyproject_wheel
%install
%pyproject_install
%pyproject_save_files -l pint
%check
# -rs: print reasons for skipped tests
%pytest -rs
%files -n python3-pint -f %{pyproject_files}
%{_bindir}/pint-convert
%changelog
%autochangelog