On 13. 09. 23 5:03, Scott Talbert wrote:
First, is it possible to use this macro if the pyproject.toml
isn't in the root
directory of the package? There doesn't seem to be an option to specify a
path, so I tried cd'ing into a path and running it, but it seemed to run into
an odd error like it was trying to include my directory as a package.
You can do this, but you MUST NOT put anything to the standard output.
E.g. if you do this:
It'll work properly. However, if you do:
It will generate a dependency on something like /builddir/build/BUILD/pkg-1.2.3
because that is what `cd -` prints to standard output.
Same with pushd and popd.
The solution is to use >&2 when runnign such commands in
%generate_buildrequires. For example:
pushd pkg1 >&2
pushd pkg2 >&2
Second, can %pyproject_buildrequires (and the other %pyproject_
macros) be used
multiple times in a package? I have a package that has multiple pyproject.toml
files in it (but that's mostly a legacy thing, so I could probably separate
them into multiple RPMs).
Yes, but %pyproject_insatll SHOULD only be used once (it will install
everything, running it multiple times is redundant) and %pyproject_save_files
will not work at all.
# this will install both wheels:
# we cannot use %%pyproject_save_files here
# because mixing files from multiple wheels is not supported