|
|
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
|
|
|
7e5adc9 |
Release: 21%{?dist}
|
|
|
fdf5116 |
|
|
|
2800b49 |
# Macro files
|
|
|
2800b49 |
Source001: macros.pyproject
|
|
|
fdf5116 |
|
|
|
2800b49 |
# Implementation files
|
|
|
2800b49 |
Source101: pyproject_buildrequires.py
|
|
|
2800b49 |
Source102: pyproject_save_files.py
|
|
|
fdf5116 |
|
|
|
2800b49 |
# Tests
|
|
|
2800b49 |
Source201: test_pyproject_buildrequires.py
|
|
|
2800b49 |
Source202: test_pyproject_save_files.py
|
|
|
2800b49 |
|
|
|
2800b49 |
# Test data
|
|
|
2800b49 |
Source301: pyproject_buildrequires_testcases.yaml
|
|
|
2800b49 |
Source302: pyproject_save_files_test_data.yaml
|
|
|
2800b49 |
Source303: test_RECORD
|
|
|
2800b49 |
|
|
|
2800b49 |
# Metadata
|
|
|
2800b49 |
Source901: README.md
|
|
|
2800b49 |
Source902: LICENSE
|
|
|
50645e1 |
|
|
|
a4df3c9 |
URL: https://src.fedoraproject.org/rpms/pyproject-rpm-macros
|
|
|
fdf5116 |
|
|
|
162b0ca |
BuildArch: noarch
|
|
|
162b0ca |
|
|
|
162b0ca |
Requires: python3-pip >= 19
|
|
|
162b0ca |
Requires: python3-devel
|
|
|
162b0ca |
|
|
|
d262d90 |
# We keep these here for now to avoid one loop of %%generate_buildrequires
|
|
|
d262d90 |
# But those are also always in the output of %%generate_buildrequires
|
|
|
d262d90 |
# in order to be removable in the future
|
|
|
d262d90 |
Requires: python3dist(packaging)
|
|
|
ed5dd77 |
Requires: python3dist(toml)
|
|
|
d262d90 |
|
|
|
d262d90 |
# This is not output from %%generate_buildrequires to work around:
|
|
|
d262d90 |
# https://github.com/rpm-software-management/mock/issues/336
|
|
|
d262d90 |
Requires: (python3dist(importlib-metadata) if python3 < 3.8)
|
|
|
d262d90 |
|
|
|
204b801 |
%if %{with tests}
|
|
|
50645e1 |
BuildRequires: python3dist(pytest)
|
|
|
50645e1 |
BuildRequires: python3dist(pyyaml)
|
|
|
50645e1 |
BuildRequires: python3dist(packaging)
|
|
|
d262d90 |
%if 0%{fedora} < 32
|
|
|
d262d90 |
# The %%if should not be needed, it works around:
|
|
|
d262d90 |
# https://github.com/rpm-software-management/mock/issues/336
|
|
|
d262d90 |
BuildRequires: (python3dist(importlib-metadata) if python3 < 3.8)
|
|
|
d262d90 |
%endif
|
|
|
50645e1 |
BuildRequires: python3dist(pip)
|
|
|
bc156c4 |
BuildRequires: python3dist(setuptools)
|
|
|
ed5dd77 |
BuildRequires: python3dist(toml)
|
|
|
fda0a23 |
BuildRequires: python3dist(tox-current-env) >= 0.0.2
|
|
|
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/
|
|
|
2800b49 |
install -m 644 pyproject_save_files.py %{buildroot}%{_rpmconfigdir}/redhat/
|
|
|
162b0ca |
|
|
|
204b801 |
%if %{with tests}
|
|
|
50645e1 |
%check
|
|
|
37216e7 |
export HOSTNAME="rpmbuild" # to speedup tox in network-less mock, see rhbz#1856356
|
|
|
2800b49 |
%{python3} -m pytest -vv --doctest-modules
|
|
|
204b801 |
%endif
|
|
|
50645e1 |
|
|
|
50645e1 |
|
|
|
162b0ca |
%files
|
|
|
162b0ca |
%{_rpmmacrodir}/macros.pyproject
|
|
|
fdf5116 |
%{_rpmconfigdir}/redhat/pyproject_buildrequires.py
|
|
|
2800b49 |
%{_rpmconfigdir}/redhat/pyproject_save_files.py
|
|
|
162b0ca |
|
|
|
162b0ca |
%doc README.md
|
|
|
162b0ca |
%license LICENSE
|
|
|
162b0ca |
|
|
|
162b0ca |
%changelog
|
|
|
7e5adc9 |
* Tue Aug 04 2020 Miro Hrončok <mhroncok@redhat.com> - 0-21
|
|
|
7e5adc9 |
- Actually implement %%pyproject_extras_subpkg
|
|
|
7e5adc9 |
|
|
|
cb4e43c |
* Wed Jul 29 2020 Miro Hrončok <mhroncok@redhat.com> - 0-20
|
|
|
cb4e43c |
- Implement %%pyproject_extras_subpkg
|
|
|
cb4e43c |
|
|
|
26607dc |
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0-19
|
|
|
26607dc |
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
|
|
|
26607dc |
|
|
|
262f6d3 |
* Thu Jul 16 2020 Miro Hrončok <mhroncok@redhat.com> - 0-18
|
|
|
262f6d3 |
- %%pyproject_buildrequires -x (extras requires for tests) now implies -r
|
|
|
262f6d3 |
(runtime requires) instead of erroring without it for better UX.
|
|
|
262f6d3 |
|
|
|
37216e7 |
* Wed Jul 15 2020 Miro Hrončok <mhroncok@redhat.com> - 0-17
|
|
|
37216e7 |
- Set HOSTNAME to prevent tox 3.17+ from a DNS query
|
|
|
37216e7 |
- Fixes rhbz#1856356
|
|
|
37216e7 |
|
|
|
ed5dd77 |
* Fri Jun 19 2020 Miro Hrončok <mhroncok@redhat.com> - 0-16
|
|
|
ed5dd77 |
- Switch from upstream deprecated pytoml to toml
|
|
|
ed5dd77 |
|
|
|
19f84b1 |
* Thu May 07 2020 Tomas Hrnciar <thrnciar@redhat.com> - 0-15
|
|
|
19f84b1 |
- Adapt %%pyproject_install not to create a PEP 610 direct_url.json file
|
|
|
19f84b1 |
|
|
|
2800b49 |
* Wed Apr 15 2020 Patrik Kopkan <pkopkan@redhat.com> - 0-14
|
|
|
2800b49 |
- Add %%pyproject_save_file macro for generating file section
|
|
|
95ba837 |
- Handle extracting debuginfo from extension modules (#1806625)
|
|
|
2800b49 |
|
|
|
99d952c |
* Mon Mar 02 2020 Miro Hrončok <mhroncok@redhat.com> - 0-13
|
|
|
99d952c |
- Tox dependency generator: Handle deps read in from a text file (#1808601)
|
|
|
99d952c |
|
|
|
6210f94 |
* Wed Feb 05 2020 Miro Hrončok <mhroncok@redhat.com> - 0-12
|
|
|
6210f94 |
- Fallback to setuptools.build_meta:__legacy__ backend instead of setuptools.build_meta
|
|
|
6210f94 |
- Properly handle backends with colon
|
|
|
dbb90f5 |
- Preserve existing flags in shebangs of Python files in /usr/bin
|
|
|
6210f94 |
|
|
|
52b92ea |
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0-11
|
|
|
52b92ea |
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
|
|
|
52b92ea |
|
|
|
49a323e |
* Fri Nov 15 2019 Patrik Kopkan <pkopkan@redhat.com> - 0-10
|
|
|
49a323e |
- Install wheel in '$PWD/pyproject-macros-wheeldir' to have more explicit path from which we install.
|
|
|
49a323e |
- The path can be changed by redefining %%_pyproject_wheeldir.
|
|
|
49a323e |
|
|
|
8cce1fa |
* Wed Nov 13 2019 Anna Khaitovich <akhaitov@redhat.com> - 0-9
|
|
|
8cce1fa |
- Remove stray __pycache__ directory from /usr/bin when running %%pyproject_install
|
|
|
8cce1fa |
|
|
|
d5c3fb3 |
* Fri Oct 25 2019 Miro Hrončok <mhroncok@redhat.com> - 0-8
|
|
|
d5c3fb3 |
- When tox fails, print tox output before failing
|
|
|
d5c3fb3 |
|
|
|
1026263 |
* Tue Oct 08 2019 Miro Hrončok <mhroncok@redhat.com> - 0-7
|
|
|
1026263 |
- Move a verbose line of %%pyproject_buildrequires from stdout to stderr
|
|
|
1026263 |
|
|
|
137aa31 |
* Fri Jul 26 2019 Petr Viktorin <pviktori@redhat.com> - 0-6
|
|
|
137aa31 |
- Use importlib_metadata rather than pip freeze
|
|
|
137aa31 |
|
|
|
8a60635 |
* Fri Jul 26 2019 Miro Hrončok <mhroncok@redhat.com> - 0-5
|
|
|
8a60635 |
- Allow to fetch test dependencies from tox
|
|
|
ec07317 |
- Add %%tox macro to invoke tests
|
|
|
8a60635 |
|
|
|
6cfe9d4 |
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0-4
|
|
|
6cfe9d4 |
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
|
|
|
6cfe9d4 |
|
|
|
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
|