Blame SPECS/python-tomli.spec

rdobuilder bcd39c
# This package buildrequires flit_core to build the wheel, but flit_core requires tomli.
rdobuilder bcd39c
# To bootstrap, we copy the files to appropriate locations manually and create a minimal dist-info metadata.
rdobuilder bcd39c
# Note that as a pure Python package, the wheel contains no pre-built binary stuff.
rdobuilder bcd39c
# When bootstrap is enabled, we don't run tests either, just an import check.
rdobuilder bcd39c
%bcond_with     bootstrap
rdobuilder bcd39c
rdobuilder bcd39c
Name:           python-tomli
rdobuilder bcd39c
Version:        2.0.1
rdobuilder bcd39c
Release:        4%{?dist}
rdobuilder bcd39c
Summary:        A little TOML parser for Python
rdobuilder bcd39c
rdobuilder bcd39c
License:        MIT
rdobuilder bcd39c
URL:            https://pypi.org/project/tomli/
rdobuilder bcd39c
Source0:        https://github.com/hukkin/tomli/archive/%{version}/%{name}-%{version}.tar.gz
rdobuilder bcd39c
rdobuilder bcd39c
BuildArch:      noarch
rdobuilder bcd39c
BuildRequires:  python3-devel
rdobuilder bcd39c
BuildRequires:  pyproject-rpm-macros
rdobuilder bcd39c
rdobuilder bcd39c
%if %{without bootstrap}
rdobuilder bcd39c
# Upstream test requirements are in tests/requirements.txt,
rdobuilder bcd39c
# but they're mixed together with coverage ones. Tests only need:
rdobuilder bcd39c
BuildRequires:  python3-pytest
rdobuilder bcd39c
BuildRequires:  python3-dateutil
rdobuilder bcd39c
%endif
rdobuilder bcd39c
rdobuilder bcd39c
%global _description %{expand:
rdobuilder bcd39c
Tomli is a Python library for parsing TOML.
rdobuilder bcd39c
Tomli is fully compatible with TOML v1.0.0.}
rdobuilder bcd39c
rdobuilder bcd39c
rdobuilder bcd39c
%description %_description
rdobuilder bcd39c
rdobuilder bcd39c
%package -n python3-tomli
rdobuilder bcd39c
Summary:        %{summary}
rdobuilder bcd39c
rdobuilder bcd39c
%description -n python3-tomli %_description
rdobuilder bcd39c
rdobuilder bcd39c
rdobuilder bcd39c
%prep
rdobuilder bcd39c
%autosetup -p1 -n tomli-%{version}
rdobuilder bcd39c
rdobuilder bcd39c
rdobuilder bcd39c
%if %{without bootstrap}
rdobuilder bcd39c
%generate_buildrequires
rdobuilder bcd39c
%pyproject_buildrequires -r
rdobuilder bcd39c
%endif
rdobuilder bcd39c
rdobuilder bcd39c
rdobuilder bcd39c
%build
rdobuilder bcd39c
%if %{without bootstrap}
rdobuilder bcd39c
%pyproject_wheel
rdobuilder bcd39c
%else
rdobuilder bcd39c
%global distinfo tomli-%{version}+rpmbootstrap.dist-info
rdobuilder bcd39c
mkdir %{distinfo}
rdobuilder bcd39c
cat > %{distinfo}/METADATA << EOF
rdobuilder bcd39c
Metadata-Version: 2.2
rdobuilder bcd39c
Name: tomli
rdobuilder bcd39c
Version: %{version}+rpmbootstrap
rdobuilder bcd39c
EOF
rdobuilder bcd39c
%endif
rdobuilder bcd39c
rdobuilder bcd39c
rdobuilder bcd39c
%install
rdobuilder bcd39c
%if %{without bootstrap}
rdobuilder bcd39c
%pyproject_install
rdobuilder bcd39c
%pyproject_save_files tomli
rdobuilder bcd39c
%else
rdobuilder bcd39c
mkdir -p %{buildroot}%{python3_sitelib}
rdobuilder bcd39c
cp -a src/tomli %{distinfo} %{buildroot}%{python3_sitelib}
rdobuilder bcd39c
echo '%{python3_sitelib}/tomli/' > %{pyproject_files}
rdobuilder bcd39c
echo '%{python3_sitelib}/%{distinfo}/' >> %{pyproject_files}
rdobuilder bcd39c
%endif
rdobuilder bcd39c
rdobuilder bcd39c
rdobuilder bcd39c
%check
rdobuilder bcd39c
%py3_check_import tomli
rdobuilder bcd39c
%if %{without bootstrap}
rdobuilder bcd39c
# assert the properly built package has no runtime requires
rdobuilder bcd39c
# if it does, we need to change the bootstrap metadata
rdobuilder bcd39c
test -f %{buildroot}%{python3_sitelib}/tomli-%{version}.dist-info/METADATA
rdobuilder bcd39c
grep '^Requires-Dist:' %{buildroot}%{python3_sitelib}/tomli-%{version}.dist-info/METADATA && exit 1 || true
rdobuilder bcd39c
%pytest
rdobuilder bcd39c
%endif
rdobuilder bcd39c
rdobuilder bcd39c
rdobuilder bcd39c
%files -n python3-tomli -f %{pyproject_files}
rdobuilder bcd39c
%doc README.md
rdobuilder bcd39c
%doc CHANGELOG.md
rdobuilder bcd39c
%license LICENSE
rdobuilder bcd39c
rdobuilder bcd39c
rdobuilder bcd39c
%changelog
rdobuilder bcd39c
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.1-4
rdobuilder bcd39c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
rdobuilder bcd39c
rdobuilder bcd39c
* Mon Jun 13 2022 Python Maint <python-maint@redhat.com> - 2.0.1-3
rdobuilder bcd39c
- Rebuilt for Python 3.11
rdobuilder bcd39c
rdobuilder bcd39c
* Mon Jun 13 2022 Python Maint <python-maint@redhat.com> - 2.0.1-2
rdobuilder bcd39c
- Bootstrap for Python 3.11
rdobuilder bcd39c
rdobuilder bcd39c
* Thu Mar 03 2022 Petr Viktorin <pviktori@redhat.com> - 2.0.1-1
rdobuilder bcd39c
- Version 2.0.1
rdobuilder bcd39c
  - Removed support for text file objects as load input
rdobuilder bcd39c
  - First argument of load and loads can no longer be passed by keyword
rdobuilder bcd39c
  - Raise an error when dotted keys define values outside the "current table"
rdobuilder bcd39c
  - Prepare for inclusion in stdlib
rdobuilder bcd39c
rdobuilder bcd39c
* Wed Feb 02 2022 Petr Viktorin <pviktori@redhat.com> - 1.2.3-1
rdobuilder bcd39c
- Update to 1.2.3
rdobuilder bcd39c
  - Allow lower case "t" and "z" in datetimes
rdobuilder bcd39c
rdobuilder bcd39c
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.2-3
rdobuilder bcd39c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
rdobuilder bcd39c
rdobuilder bcd39c
* Fri Oct 29 2021 Miro HronĨok <mhroncok@redhat.com> - 1.2.2-2
rdobuilder bcd39c
- Allow a bootstrap build without flit_core
rdobuilder bcd39c
rdobuilder bcd39c
* Wed Oct 27 2021 Petr Viktorin <pviktori@redhat.com> - 1.2.2-1
rdobuilder bcd39c
- Update to version 1.2.2
rdobuilder bcd39c
rdobuilder bcd39c
* Wed Aug 18 2021 Petr Viktorin <pviktori@redhat.com> - 1.2.1-1
rdobuilder bcd39c
- Update to version 1.2.1
rdobuilder bcd39c
  - loading text (as opposed to binary) files is deprecated
rdobuilder bcd39c
rdobuilder bcd39c
* Thu Jul 29 2021 Petr Viktorin <pviktori@redhat.com> - 1.1.0-1
rdobuilder bcd39c
- Update to version 1.1.0
rdobuilder bcd39c
  - `load` can now take a binary file object
rdobuilder bcd39c
rdobuilder bcd39c
* Thu Jul 22 2021 Petr Viktorin <pviktori@redhat.com> - 1.0.4-1
rdobuilder bcd39c
- Initial package