2019-07-02 12:41:04 +02:00
|
|
|
Name: pyproject-rpm-macros
|
2019-07-02 16:53:05 +02:00
|
|
|
Summary: RPM macros for PEP 517 Python packages
|
2019-07-02 12:41:04 +02:00
|
|
|
License: MIT
|
2019-07-02 16:53:05 +02:00
|
|
|
|
2019-07-17 17:34:24 +02:00
|
|
|
%bcond_without tests
|
|
|
|
|
2019-07-02 16:53:05 +02:00
|
|
|
# Keep the version at zero and increment only release
|
|
|
|
Version: 0
|
2020-10-06 00:30:45 +02:00
|
|
|
Release: 31%{?dist}
|
2019-07-02 16:53:05 +02:00
|
|
|
|
2020-04-15 16:44:04 +02:00
|
|
|
# Macro files
|
|
|
|
Source001: macros.pyproject
|
2019-07-02 16:53:05 +02:00
|
|
|
|
2020-04-15 16:44:04 +02:00
|
|
|
# Implementation files
|
|
|
|
Source101: pyproject_buildrequires.py
|
|
|
|
Source102: pyproject_save_files.py
|
2020-09-09 06:47:51 +02:00
|
|
|
Source103: pyproject_convert.py
|
2020-09-15 08:55:44 +02:00
|
|
|
Source104: pyproject_preprocess_record.py
|
2019-07-02 16:53:05 +02:00
|
|
|
|
2020-04-15 16:44:04 +02:00
|
|
|
# Tests
|
|
|
|
Source201: test_pyproject_buildrequires.py
|
|
|
|
Source202: test_pyproject_save_files.py
|
|
|
|
|
|
|
|
# Test data
|
|
|
|
Source301: pyproject_buildrequires_testcases.yaml
|
|
|
|
Source302: pyproject_save_files_test_data.yaml
|
|
|
|
Source303: test_RECORD
|
|
|
|
|
|
|
|
# Metadata
|
|
|
|
Source901: README.md
|
|
|
|
Source902: LICENSE
|
2019-07-17 15:44:22 +02:00
|
|
|
|
2019-07-02 13:05:10 +02:00
|
|
|
URL: https://src.fedoraproject.org/rpms/pyproject-rpm-macros
|
2019-07-02 16:53:05 +02:00
|
|
|
|
2019-07-02 12:41:04 +02:00
|
|
|
BuildArch: noarch
|
|
|
|
|
2019-07-17 17:34:24 +02:00
|
|
|
%if %{with tests}
|
2019-07-17 15:44:22 +02:00
|
|
|
BuildRequires: python3dist(pytest)
|
|
|
|
BuildRequires: python3dist(pyyaml)
|
|
|
|
BuildRequires: python3dist(packaging)
|
2019-08-10 14:34:24 +02:00
|
|
|
%if 0%{fedora} < 32
|
|
|
|
# The %%if should not be needed, it works around:
|
|
|
|
# https://github.com/rpm-software-management/mock/issues/336
|
|
|
|
BuildRequires: (python3dist(importlib-metadata) if python3 < 3.8)
|
|
|
|
%endif
|
2019-07-17 15:44:22 +02:00
|
|
|
BuildRequires: python3dist(pip)
|
2019-07-17 18:16:16 +02:00
|
|
|
BuildRequires: python3dist(setuptools)
|
2020-06-19 21:49:54 +02:00
|
|
|
BuildRequires: python3dist(toml)
|
2020-09-30 22:12:03 +02:00
|
|
|
BuildRequires: python3dist(tox-current-env) >= 0.0.3
|
2019-07-17 18:16:16 +02:00
|
|
|
BuildRequires: python3dist(wheel)
|
2019-07-17 17:34:24 +02:00
|
|
|
%endif
|
2019-07-17 15:44:22 +02:00
|
|
|
|
|
|
|
|
2019-07-02 12:41:04 +02:00
|
|
|
%description
|
|
|
|
This is a provisional implementation of pyproject RPM macros for Fedora 30+.
|
|
|
|
These macros are useful for packaging Python projects that use the PEP 517
|
|
|
|
pyproject.toml file, which specifies the package's build dependencies
|
|
|
|
(including the build system, such as setuptools, flit or poetry).
|
|
|
|
|
2019-07-02 16:53:05 +02:00
|
|
|
|
2019-07-02 12:41:04 +02:00
|
|
|
%prep
|
2019-07-02 13:40:47 +02:00
|
|
|
# Not strictly necessary but allows working on file names instead
|
|
|
|
# of source numbers in install section
|
|
|
|
%setup -c -T
|
|
|
|
cp -p %{sources} .
|
2019-07-02 12:41:04 +02:00
|
|
|
|
|
|
|
%build
|
|
|
|
# nothing to do, sources are not buildable
|
|
|
|
|
|
|
|
%install
|
2019-07-02 16:53:05 +02:00
|
|
|
mkdir -p %{buildroot}%{_rpmmacrodir}
|
|
|
|
mkdir -p %{buildroot}%{_rpmconfigdir}/redhat
|
|
|
|
install -m 644 macros.pyproject %{buildroot}%{_rpmmacrodir}/
|
|
|
|
install -m 644 pyproject_buildrequires.py %{buildroot}%{_rpmconfigdir}/redhat/
|
2020-09-09 06:47:51 +02:00
|
|
|
install -m 644 pyproject_convert.py %{buildroot}%{_rpmconfigdir}/redhat/
|
2020-04-15 16:44:04 +02:00
|
|
|
install -m 644 pyproject_save_files.py %{buildroot}%{_rpmconfigdir}/redhat/
|
2020-09-15 08:55:44 +02:00
|
|
|
install -m 644 pyproject_preprocess_record.py %{buildroot}%{_rpmconfigdir}/redhat/
|
2019-07-02 12:41:04 +02:00
|
|
|
|
2019-07-17 17:34:24 +02:00
|
|
|
%if %{with tests}
|
2019-07-17 15:44:22 +02:00
|
|
|
%check
|
2020-07-15 12:15:19 +02:00
|
|
|
export HOSTNAME="rpmbuild" # to speedup tox in network-less mock, see rhbz#1856356
|
2020-04-15 16:44:04 +02:00
|
|
|
%{python3} -m pytest -vv --doctest-modules
|
2019-07-17 17:34:24 +02:00
|
|
|
%endif
|
2019-07-17 15:44:22 +02:00
|
|
|
|
|
|
|
|
2019-07-02 12:41:04 +02:00
|
|
|
%files
|
|
|
|
%{_rpmmacrodir}/macros.pyproject
|
2019-07-02 16:53:05 +02:00
|
|
|
%{_rpmconfigdir}/redhat/pyproject_buildrequires.py
|
2020-09-09 06:47:51 +02:00
|
|
|
%{_rpmconfigdir}/redhat/pyproject_convert.py
|
2020-04-15 16:44:04 +02:00
|
|
|
%{_rpmconfigdir}/redhat/pyproject_save_files.py
|
2020-09-15 08:55:44 +02:00
|
|
|
%{_rpmconfigdir}/redhat/pyproject_preprocess_record.py
|
2019-07-02 12:41:04 +02:00
|
|
|
|
|
|
|
%doc README.md
|
|
|
|
%license LICENSE
|
|
|
|
|
|
|
|
%changelog
|
2020-10-06 00:30:45 +02:00
|
|
|
* Mon Oct 05 2020 Miro Hrončok <mhroncok@redhat.com> - 0-31
|
|
|
|
- Support PEP 517 list based backend-path
|
|
|
|
|
2020-09-29 13:06:05 +02:00
|
|
|
* Tue Sep 29 2020 Lumír Balhar <lbalhar@redhat.com> - 0-30
|
|
|
|
- Process RECORD files in %%pyproject_install and remove them
|
2020-09-30 22:12:03 +02:00
|
|
|
- Support the extras configuration option of tox in %%pyproject_buildrequires -t
|
2020-09-30 22:31:07 +02:00
|
|
|
- Support multiple -x options for %%pyproject_buildrequires
|
2020-09-30 22:12:03 +02:00
|
|
|
- Fixes: rhbz#1877977
|
2020-09-30 22:31:07 +02:00
|
|
|
- Fixes: rhbz#1877978
|
2020-09-29 13:06:05 +02:00
|
|
|
|
2020-09-23 11:10:30 +02:00
|
|
|
* Wed Sep 23 2020 Miro Hrončok <mhroncok@redhat.com> - 0-29
|
|
|
|
- Check the requirements after installing "requires_for_build_wheel"
|
|
|
|
- If not checked, installing runtime requirements might fail
|
|
|
|
|
2020-09-12 09:53:24 +02:00
|
|
|
* Tue Sep 08 2020 Gordon Messmer <gordon.messmer@gmail.com> - 0-28
|
2020-09-09 06:47:51 +02:00
|
|
|
- Support more Python version specifiers in generated BuildRequires
|
|
|
|
- This adds support for the '~=' operator and wildcards
|
|
|
|
|
2020-09-12 09:53:24 +02:00
|
|
|
* Fri Sep 04 2020 Miro Hrončok <miro@hroncok.cz> - 0-27
|
2020-09-04 00:16:27 +02:00
|
|
|
- Make code in $PWD importable from %%pyproject_buildrequires
|
2020-09-04 11:49:36 +02:00
|
|
|
- Only require toml for projects with pyproject.toml
|
2020-09-07 11:44:48 +02:00
|
|
|
- Remove a no longer useful warning for unrecognized files in %%pyproject_save_files
|
2020-09-04 00:16:27 +02:00
|
|
|
|
2020-08-11 14:12:34 +02:00
|
|
|
* Mon Aug 24 2020 Tomas Hrnciar <thrnciar@redhat.com> - 0-26
|
|
|
|
- Implement automatic detection of %%lang files in %%pyproject_save_files
|
|
|
|
and mark them with %%lang in filelist
|
|
|
|
|
2020-08-14 14:57:40 +02:00
|
|
|
* Fri Aug 14 2020 Miro Hrončok <mhroncok@redhat.com> - 0-25
|
|
|
|
- Handle Python Extras in %%pyproject_buildrequires on Fedora 33+
|
|
|
|
|
2020-08-11 15:22:05 +02:00
|
|
|
* Tue Aug 11 2020 Miro Hrončok <mhroncok@redhat.com> - 0-24
|
|
|
|
- Allow multiple, comma-separated extras in %%pyproject_buildrequires -x
|
|
|
|
|
2020-08-10 12:05:45 +02:00
|
|
|
* Mon Aug 10 2020 Lumír Balhar <lbalhar@redhat.com> - 0-23
|
|
|
|
- Make macros more universal for alternative Python stacks
|
|
|
|
|
2020-07-01 13:34:36 +02:00
|
|
|
* Thu Aug 06 2020 Tomas Hrnciar <thrnciar@redhat.com> - 0-22
|
|
|
|
- Change %%pyproject_save_files +bindir argument to +auto
|
|
|
|
to list all unclassified files in filelist
|
|
|
|
|
2020-08-04 15:08:18 +02:00
|
|
|
* Tue Aug 04 2020 Miro Hrončok <mhroncok@redhat.com> - 0-21
|
|
|
|
- Actually implement %%pyproject_extras_subpkg
|
|
|
|
|
2020-07-29 12:49:15 +02:00
|
|
|
* Wed Jul 29 2020 Miro Hrončok <mhroncok@redhat.com> - 0-20
|
|
|
|
- Implement %%pyproject_extras_subpkg
|
|
|
|
|
2020-07-29 01:22:27 +02:00
|
|
|
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0-19
|
|
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
|
|
|
|
|
2020-07-16 13:35:02 +02:00
|
|
|
* Thu Jul 16 2020 Miro Hrončok <mhroncok@redhat.com> - 0-18
|
|
|
|
- %%pyproject_buildrequires -x (extras requires for tests) now implies -r
|
|
|
|
(runtime requires) instead of erroring without it for better UX.
|
|
|
|
|
2020-07-15 12:15:19 +02:00
|
|
|
* Wed Jul 15 2020 Miro Hrončok <mhroncok@redhat.com> - 0-17
|
|
|
|
- Set HOSTNAME to prevent tox 3.17+ from a DNS query
|
|
|
|
- Fixes rhbz#1856356
|
|
|
|
|
2020-06-19 21:49:54 +02:00
|
|
|
* Fri Jun 19 2020 Miro Hrončok <mhroncok@redhat.com> - 0-16
|
|
|
|
- Switch from upstream deprecated pytoml to toml
|
|
|
|
|
2020-05-06 12:55:13 +02:00
|
|
|
* Thu May 07 2020 Tomas Hrnciar <thrnciar@redhat.com> - 0-15
|
|
|
|
- Adapt %%pyproject_install not to create a PEP 610 direct_url.json file
|
|
|
|
|
2020-04-15 16:44:04 +02:00
|
|
|
* Wed Apr 15 2020 Patrik Kopkan <pkopkan@redhat.com> - 0-14
|
|
|
|
- Add %%pyproject_save_file macro for generating file section
|
2020-04-16 15:42:50 +02:00
|
|
|
- Handle extracting debuginfo from extension modules (#1806625)
|
2020-04-15 16:44:04 +02:00
|
|
|
|
2020-03-02 11:56:15 +01:00
|
|
|
* Mon Mar 02 2020 Miro Hrončok <mhroncok@redhat.com> - 0-13
|
|
|
|
- Tox dependency generator: Handle deps read in from a text file (#1808601)
|
|
|
|
|
Handle backends with colon, fallback to setuptools.build_meta:__legacy__
Falling back to setuptools.build_meta:__legacy__ is the standard behavior,
not setuptools.build_meta. See PEP 517:
https://www.python.org/dev/peps/pep-0517/
> If the pyproject.toml file is absent, or the build-backend key is missing,
> the source tree is not using this specification, and tools should revert
> to the legacy behaviour of running setup.py (either directly, or by
> implicitly invoking the setuptools.build_meta:__legacy__ backend).
Falling back to setuptools.build_meta had very similar results so far.,
but the behavior might change in the feature.
While working on this, I have uncovered a problem in our code.
It was not able to handle backends with ":". Looking at PEP 517 again:
> build-backend is a string naming a Python object that will be used to
> perform the build. This is formatted following the same module:object syntax
> as a setuptools entry point. For instance, if the string is "flit.api:main",
> this object would be looked up by executing the equivalent of:
>
> import flit.api
> backend = flit.api.main
>
> It's also legal to leave out the :object part, e.g.
>
> build-backend = "flit.api"
>
> which acts like:
>
> import flit.api
> backend = flit.api
We now handle such cases properly. Witch the change of the default backend,
we also test a backend with colon in our tests.
2020-02-05 13:10:51 +01:00
|
|
|
* Wed Feb 05 2020 Miro Hrončok <mhroncok@redhat.com> - 0-12
|
|
|
|
- Fallback to setuptools.build_meta:__legacy__ backend instead of setuptools.build_meta
|
|
|
|
- Properly handle backends with colon
|
2020-02-05 14:33:50 +01:00
|
|
|
- Preserve existing flags in shebangs of Python files in /usr/bin
|
Handle backends with colon, fallback to setuptools.build_meta:__legacy__
Falling back to setuptools.build_meta:__legacy__ is the standard behavior,
not setuptools.build_meta. See PEP 517:
https://www.python.org/dev/peps/pep-0517/
> If the pyproject.toml file is absent, or the build-backend key is missing,
> the source tree is not using this specification, and tools should revert
> to the legacy behaviour of running setup.py (either directly, or by
> implicitly invoking the setuptools.build_meta:__legacy__ backend).
Falling back to setuptools.build_meta had very similar results so far.,
but the behavior might change in the feature.
While working on this, I have uncovered a problem in our code.
It was not able to handle backends with ":". Looking at PEP 517 again:
> build-backend is a string naming a Python object that will be used to
> perform the build. This is formatted following the same module:object syntax
> as a setuptools entry point. For instance, if the string is "flit.api:main",
> this object would be looked up by executing the equivalent of:
>
> import flit.api
> backend = flit.api.main
>
> It's also legal to leave out the :object part, e.g.
>
> build-backend = "flit.api"
>
> which acts like:
>
> import flit.api
> backend = flit.api
We now handle such cases properly. Witch the change of the default backend,
we also test a backend with colon in our tests.
2020-02-05 13:10:51 +01:00
|
|
|
|
2020-01-30 11:14:51 +01:00
|
|
|
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0-11
|
|
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
|
|
|
|
|
2019-11-13 12:39:36 +01:00
|
|
|
* Fri Nov 15 2019 Patrik Kopkan <pkopkan@redhat.com> - 0-10
|
|
|
|
- Install wheel in '$PWD/pyproject-macros-wheeldir' to have more explicit path from which we install.
|
|
|
|
- The path can be changed by redefining %%_pyproject_wheeldir.
|
|
|
|
|
2019-11-13 12:41:31 +01:00
|
|
|
* Wed Nov 13 2019 Anna Khaitovich <akhaitov@redhat.com> - 0-9
|
|
|
|
- Remove stray __pycache__ directory from /usr/bin when running %%pyproject_install
|
|
|
|
|
When tox fails, print tox output before failing
Previously, it wasn't possible to see why tox failed:
...
Requirement satisfied: tox-current-env >= 0.0.2
(installed: tox-current-env 0.0.2)
Traceback (most recent call last):
File "/usr/lib/rpm/redhat/pyproject_buildrequires.py", line 269, in main
generate_requires(
File "/usr/lib/rpm/redhat/pyproject_buildrequires.py", line 221, in generate_requires
generate_tox_requirements(toxenv, requirements)
File "/usr/lib/rpm/redhat/pyproject_buildrequires.py", line 184, in generate_tox_requirements
r = subprocess.run(
File "/usr/lib64/python3.8/subprocess.py", line 512, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['tox', '--print-deps-to-file', '/tmp/tmp96smu4rv', '-qre', 'py38']' returned non-zero exit status 1.
Now it is:
...
Requirement satisfied: tox-current-env >= 0.0.2
(installed: tox-current-env 0.0.2)
ERROR: tox config file (either pyproject.toml, tox.ini, setup.cfg) not found
Traceback (most recent call last):
File "/usr/lib/rpm/redhat/pyproject_buildrequires.py", line 270, in main
generate_requires(
File "/usr/lib/rpm/redhat/pyproject_buildrequires.py", line 222, in generate_requires
generate_tox_requirements(toxenv, requirements)
File "/usr/lib/rpm/redhat/pyproject_buildrequires.py", line 193, in generate_tox_requirements
r.check_returncode()
File "/usr/lib64/python3.8/subprocess.py", line 444, in check_returncode
raise CalledProcessError(self.returncode, self.args, self.stdout,
subprocess.CalledProcessError: Command '['tox', '--print-deps-to-file', '/tmp/tmpwp8sffv1', '-qre', 'py38']' returned non-zero exit status 1.
Inspired by https://src.fedoraproject.org/rpms/python-chaospy/pull-request/1#comment-32750
2019-10-25 16:51:01 +02:00
|
|
|
* Fri Oct 25 2019 Miro Hrončok <mhroncok@redhat.com> - 0-8
|
|
|
|
- When tox fails, print tox output before failing
|
|
|
|
|
2019-10-08 13:01:08 +02:00
|
|
|
* Tue Oct 08 2019 Miro Hrončok <mhroncok@redhat.com> - 0-7
|
|
|
|
- Move a verbose line of %%pyproject_buildrequires from stdout to stderr
|
|
|
|
|
2019-09-20 10:18:12 +02:00
|
|
|
* Fri Jul 26 2019 Petr Viktorin <pviktori@redhat.com> - 0-6
|
|
|
|
- Use importlib_metadata rather than pip freeze
|
|
|
|
|
2019-07-26 14:34:21 +02:00
|
|
|
* Fri Jul 26 2019 Miro Hrončok <mhroncok@redhat.com> - 0-5
|
|
|
|
- Allow to fetch test dependencies from tox
|
2019-07-26 17:50:36 +02:00
|
|
|
- Add %%tox macro to invoke tests
|
2019-07-26 14:34:21 +02:00
|
|
|
|
2019-07-26 13:47:03 +02:00
|
|
|
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0-4
|
|
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
|
|
|
|
|
2019-07-02 16:53:05 +02:00
|
|
|
* Tue Jul 02 2019 Miro Hrončok <mhroncok@redhat.com> - 0-3
|
|
|
|
- Add %%pyproject_buildrequires
|
|
|
|
|
2019-07-02 14:02:54 +02:00
|
|
|
* Tue Jul 02 2019 Miro Hrončok <mhroncok@redhat.com> - 0-2
|
|
|
|
- Fix shell syntax errors in %%pyproject_install
|
|
|
|
- Drop PATH warning in %%pyproject_install
|
2019-07-02 12:41:04 +02:00
|
|
|
|
|
|
|
* Fri Jun 28 2019 Patrik Kopkan <pkopkan@redhat.com> - 0-1
|
|
|
|
- created package
|