python-tomli/python-tomli.spec

112 lines
3.0 KiB
RPMSpec
Raw Normal View History

# This package buildrequires flit_core to build the wheel, but flit_core requires tomli.
# To bootstrap, we copy the files to appropriate locations manually and create a minimal dist-info metadata.
# Note that as a pure Python package, the wheel contains no pre-built binary stuff.
# When bootstrap is enabled, we don't run tests either, just an import check.
%bcond_with bootstrap
2021-07-28 09:09:49 +00:00
Name: python-tomli
2021-10-27 14:16:46 +00:00
Version: 1.2.2
Release: 3%{?dist}
2021-07-28 09:09:49 +00:00
Summary: A little TOML parser for Python
License: MIT
URL: https://pypi.org/project/tomli/
Source0: https://github.com/hukkin/tomli/archive/refs/tags/%{version}.tar.gz
BuildArch: noarch
BuildRequires: python3-devel
%if %{without bootstrap}
# Upstream test requirements are in tests/requirements.txt,
# but they're mixed together with coverage ones. Tests only need:
BuildRequires: python3-pytest
BuildRequires: python3-dateutil
%endif
2021-07-28 09:09:49 +00:00
%global _description %{expand:
Tomli is a Python library for parsing TOML.
Tomli is fully compatible with TOML v1.0.0.}
2021-07-28 09:09:49 +00:00
%description %_description
%package -n python3-tomli
Summary: %{summary}
%description -n python3-tomli %_description
%prep
%autosetup -p1 -n tomli-%{version}
%if %{without bootstrap}
2021-07-28 09:09:49 +00:00
%generate_buildrequires
%pyproject_buildrequires -r
%endif
2021-07-28 09:09:49 +00:00
%build
%if %{without bootstrap}
2021-07-28 09:09:49 +00:00
%pyproject_wheel
%else
%global distinfo tomli-%{version}+rpmbootstrap.dist-info
mkdir %{distinfo}
cat > %{distinfo}/METADATA << EOF
Metadata-Version: 2.2
Name: tomli
Version: %{version}+rpmbootstrap
EOF
%endif
2021-07-28 09:09:49 +00:00
%install
%if %{without bootstrap}
2021-07-28 09:09:49 +00:00
%pyproject_install
%pyproject_save_files tomli
%else
mkdir -p %{buildroot}%{python3_sitelib}
cp -a tomli %{distinfo} %{buildroot}%{python3_sitelib}
echo '%{python3_sitelib}/tomli/' > %{pyproject_files}
echo '%{python3_sitelib}/%{distinfo}/' >> %{pyproject_files}
%endif
2021-07-28 09:09:49 +00:00
%check
%py3_check_import tomli
%if %{without bootstrap}
# assert the properly built package has no runtime requires
# if it does, we need to change the bootstrap metadata
test -f %{buildroot}%{python3_sitelib}/tomli-%{version}.dist-info/METADATA
! grep '^Requires-Dist:' %{buildroot}%{python3_sitelib}/tomli-%{version}.dist-info/METADATA
2021-07-28 09:09:49 +00:00
%pytest
%endif
2021-07-28 09:09:49 +00:00
%files -n python3-tomli -f %{pyproject_files}
%doc README.md
2021-07-29 08:43:39 +00:00
%doc CHANGELOG.md
2021-07-28 09:09:49 +00:00
%license LICENSE
%changelog
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Fri Oct 29 2021 Miro Hrončok <mhroncok@redhat.com> - 1.2.2-2
- Allow a bootstrap build without flit_core
2021-10-27 14:16:46 +00:00
* Wed Oct 27 2021 Petr Viktorin <pviktori@redhat.com> - 1.2.2-1
- Update to version 1.2.2
2021-08-18 12:35:05 +00:00
* Wed Aug 18 2021 Petr Viktorin <pviktori@redhat.com> - 1.2.1-1
- Update to version 1.2.1
- loading text (as opposed to binary) files is deprecated
2021-07-29 08:43:39 +00:00
* Thu Jul 29 2021 Petr Viktorin <pviktori@redhat.com> - 1.1.0-1
- Update to version 1.1.0
- `load` can now take a binary file object
2021-07-28 09:09:49 +00:00
* Thu Jul 22 2021 Petr Viktorin <pviktori@redhat.com> - 1.0.4-1
- Initial package