162b0ca
Name:           pyproject-rpm-macros
fdf5116
Summary:        RPM macros for PEP 517 Python packages
162b0ca
License:        MIT
fdf5116
204b801
%bcond_without tests
204b801
fdf5116
# Keep the version at zero and increment only release
fdf5116
Version:        0
fdf5116
Release:        3%{?dist}
fdf5116
162b0ca
Source0:        macros.pyproject
fdf5116
Source1:        pyproject_buildrequires.py
fdf5116
fdf5116
Source8:        README.md
fdf5116
Source9:        LICENSE
fdf5116
50645e1
Source10:       test_pyproject_buildrequires.py
50645e1
Source11:       testcases.yaml
50645e1
a4df3c9
URL:            https://src.fedoraproject.org/rpms/pyproject-rpm-macros
fdf5116
162b0ca
BuildArch:      noarch
162b0ca
fdf5116
# We keep them here for now to avoid one loop of %%generate_buildrequires
fdf5116
# And to allow the other macros without %%pyproject_buildrequires (e.g. on Fedora 30)
fdf5116
# But those are also always in the output of %%generate_buildrequires
fdf5116
# in order to be removable in the future
162b0ca
Requires: python3-pip >= 19
162b0ca
Requires: python3-devel
162b0ca
204b801
%if %{with tests}
50645e1
BuildRequires: python3dist(pytest)
50645e1
BuildRequires: python3dist(pyyaml)
50645e1
BuildRequires: python3dist(packaging)
50645e1
BuildRequires: python3dist(pytoml)
50645e1
BuildRequires: python3dist(pip)
bc156c4
BuildRequires: python3dist(setuptools)
bc156c4
BuildRequires: python3dist(wheel)
204b801
%endif
50645e1
50645e1
162b0ca
%description
162b0ca
This is a provisional implementation of pyproject RPM macros for Fedora 30+.
162b0ca
These macros are useful for packaging Python projects that use the PEP 517
162b0ca
pyproject.toml file, which specifies the package's build dependencies
162b0ca
(including the build system, such as setuptools, flit or poetry).
162b0ca
fdf5116
162b0ca
%prep
286c22f
# Not strictly necessary but allows working on file names instead
286c22f
# of source numbers in install section
286c22f
%setup -c -T
286c22f
cp -p %{sources} .
162b0ca
162b0ca
%build
162b0ca
# nothing to do, sources are not buildable
162b0ca
162b0ca
%install
fdf5116
mkdir -p %{buildroot}%{_rpmmacrodir}
fdf5116
mkdir -p %{buildroot}%{_rpmconfigdir}/redhat
fdf5116
install -m 644 macros.pyproject %{buildroot}%{_rpmmacrodir}/
fdf5116
install -m 644 pyproject_buildrequires.py %{buildroot}%{_rpmconfigdir}/redhat/
162b0ca
204b801
%if %{with tests}
50645e1
%check
50645e1
%{__python3} -m pytest -vv
204b801
%endif
50645e1
50645e1
162b0ca
%files
162b0ca
%{_rpmmacrodir}/macros.pyproject
fdf5116
%{_rpmconfigdir}/redhat/pyproject_buildrequires.py
162b0ca
162b0ca
%doc README.md
162b0ca
%license LICENSE
162b0ca
162b0ca
%changelog
fdf5116
* Tue Jul 02 2019 Miro Hrončok <mhroncok@redhat.com> - 0-3
fdf5116
- Add %%pyproject_buildrequires
fdf5116
48b7c9c
* Tue Jul 02 2019 Miro Hrončok <mhroncok@redhat.com> - 0-2
48b7c9c
- Fix shell syntax errors in %%pyproject_install
48b7c9c
- Drop PATH warning in %%pyproject_install
162b0ca
162b0ca
* Fri Jun 28 2019 Patrik Kopkan <pkopkan@redhat.com> - 0-1
162b0ca
- created package