On 5/21/26 03:28, Miro Hrončok wrote:
On 21. 05. 26 7:20, Orion Poplawski via python-devel wrote:
python-scikit-image's pyproject.toml file has a section with:
[build-system]
build-backend = 'mesonpy'
requires = [
'meson-python>=0.16',
'Cython>=3.0.8,!=3.2.0b1',
'pythran>=0.16',
'lazy_loader>=0.4',
'numpy>=2.0',
]
how can I get %pyproject_generatebuildrequires to add those dependencies?
That should be the default behavior. build-system.requires are always
generated (unless with -N/--no-use-build-system).
Nevermind - apparnelty that would require -w to generate,
but that's going to be too expensive.
That should *not* be the case. If the mesonpy build backend does not
support the prepare_metadata_for_build_wheel PPE 517 hook, you can
always use -R/--no-runtime which would skip the runtime deps but still
generate the build-system.requires.
Or use -p/--pyproject-dependencies, which would read the runtime
dependencies from project.dependencies. Nevertheless, that is not
related to build-system.requires.
[scikit_image-0.26.0]$ python /usr/lib/rpm/redhat/
pyproject_buildrequires.py --output=deps && cat deps
...
python3dist(meson-python) >= 0.16
((python3dist(cython) < 3.2~b1 or python3dist(cython) > 3.2~b1) with
python3dist(cython) >= 3.0.8)
python3dist(pythran) >= 0.16
python3dist(lazy-loader) >= 0.4
python3dist(numpy) >= 2
Without any options I get:
Traceback (most recent call last):
File "/usr/lib/rpm/redhat/pyproject_buildrequires.py", line 850, in main
generate_requires(
~~~~~~~~~~~~~~~~~^
include_runtime=args.runtime,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<12 lines>...
dependency_overrides=dependency_overrides,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/usr/lib/rpm/redhat/pyproject_buildrequires.py", line 705, in
generate_requires
generate_run_requirements(backend, requirements,
build_wheel=build_wheel,
~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pyproject_dependencies=pyproject_dependencies, wheeldir=wheeldir)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/rpm/redhat/pyproject_buildrequires.py", line 509, in
generate_run_requirements
generate_run_requirements_hook(backend, requirements)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/rpm/redhat/pyproject_buildrequires.py", line 414, in
generate_run_requirements_hook
raise ValueError(
...<5 lines>...
)
ValueError: The build backend cannot provide build metadata (incl.
runtime requirements) before build. If the dependencies are specified in
the pyproject.toml [project] table, you can use the -p flag to read
them. Alternatively, use the -R flag not to generate runtime dependencies.
and pyproject.toml [project] section has:
dependencies = [
'numpy>=1.24',
'scipy>=1.11.4',
'networkx>=3.0',
'pillow>=10.1',
'imageio>=2.33,!=2.35.0',
'tifffile>=2022.8.12',
'packaging>=21',
'lazy-loader>=0.4',
]
so that's why I went with -p. -p and -R appear to be mutually exclusive
so it seems like I can choose one set of deps or the other? Although it
looks like the deps generated with -p is a superset of those generated
with -R, so no big deal I guess.
--
Orion Poplawski
he/him/his - surely the least important thing about me
IT Systems Manager 720-772-5637
NWRA, Boulder/CoRA Office FAX: 303-415-9702
3380 Mitchell Lane [email protected]
Boulder, CO 80301 https://www.nwra.com/
--
_______________________________________________
python-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]
Fedora Code of Conduct:
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives:
https://lists.fedoraproject.org/archives/list/[email protected]
Do not reply to spam, report it:
https://forge.fedoraproject.org/infra/tickets/issues/new