| |
@@ -23,14 +23,16 @@
|
| |
Usage
|
| |
-----
|
| |
|
| |
- To use these macros, first BuildRequire them:
|
| |
+ To use these macros, first BuildRequire the devel package for the Python you
|
| |
+ are building against. In Fedora, that's `python3-devel`.
|
| |
|
| |
- BuildRequires: pyproject-rpm-macros
|
| |
+ BuildRequires: python3-devel
|
| |
+
|
| |
+ The macros will be pulled in as a dependency on Fedora and EPEL 9+.
|
| |
+ In other distributions you need to BuildRequire the macros as well:
|
| |
|
| |
- Also BuildRequire the devel package for the Python you are building against.
|
| |
- In Fedora, that's `python3-devel`.
|
| |
- (In the future, we plan to make `python3-devel` itself require
|
| |
- `pyproject-rpm-macros`.)
|
| |
+ BuildRequires: python3-devel
|
| |
+ BuildRequires: pyproject-rpm-macros
|
| |
|
| |
Next, you need to generate more build dependencies (of your projects and
|
| |
the macros themselves) by running `%pyproject_buildrequires` in the
|
| |
@@ -40,7 +42,8 @@
|
| |
%pyproject_buildrequires
|
| |
|
| |
This will add build dependencies according to [PEP 517] and [PEP 518].
|
| |
- To also add run-time and test-time dependencies, see the section below.
|
| |
+ This also adds run-time dependencies by default and
|
| |
+ can add test-time dependencies, see the section below.
|
| |
If you need more dependencies, such as non-Python libraries, BuildRequire
|
| |
them manually.
|
| |
|
| |
@@ -66,17 +69,22 @@
|
| |
Adding run-time and test-time dependencies
|
| |
------------------------------------------
|
| |
|
| |
- To run tests in the `%check` section, the package's runtime dependencies
|
| |
- often need to also be included as build requirements.
|
| |
- This can be done using the `-r` flag:
|
| |
+ To run tests or import checks in the `%check` section,
|
| |
+ the package's runtime dependencies need to also be included as build requirements.
|
| |
|
| |
- %generate_buildrequires
|
| |
- %pyproject_buildrequires -r
|
| |
+ Hence, `%pyproject_buildrequires` also generates runtime dependencies by default.
|
| |
|
| |
For this to work, the project's build system must support the
|
| |
[`prepare-metadata-for-build-wheel` hook](https://www.python.org/dev/peps/pep-0517/#prepare-metadata-for-build-wheel).
|
| |
The popular buildsystems (setuptools, flit, poetry) do support it.
|
| |
|
| |
+ This behavior can be disabled
|
| |
+ (e.g. when the project's build system does not support it)
|
| |
+ using the `-R` flag:
|
| |
+
|
| |
+ %generate_buildrequires
|
| |
+ %pyproject_buildrequires -R
|
| |
+
|
| |
For projects that specify test requirements using an [`extra`
|
| |
provide](https://packaging.python.org/specifications/core-metadata/#provides-extra-multiple-use),
|
| |
these can be added using the `-x` flag.
|
| |