pyproject.yaml missing build-backend key causes Fedora buildsystem to call non-existent setup.py #932

Closed
opened 2024-11-11 01:00:31 +00:00 by kaechele · 2 comments
Contributor

What I'm trying to do and why

pyproject.yaml is missing the build-backend key. It's there, but commented out.

Fedora's buildsystem, in adherence with PEP 517, will then try to execute the non-existent setup.py.

Relevant PEP 517 quote:

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).

Steps to reproduce

Downloading the latest borgmatic RPM spec file and try building it locally or in mock.

Actual behavior

Snippet from Fedora buildsystem:

+ /usr/bin/python3 -Bs /usr/lib/rpm/redhat/pyproject_buildrequires.py --generate-extras --python3_pkgversion 3 --wheeldir /builddir/build/BUILD/borgmatic-1.9.1-build/pyproject-wheeldir --output /builddir/build/BUILD/borgmatic-1.9.1-build/borgmatic-1.9.1-2.fc42.x86_64-pyproject-buildrequires
Handling setuptools>=61.0 from build-system.requires
Requirement not satisfied: setuptools>=61.0
Traceback (most recent call last):
  File "/usr/lib/rpm/redhat/pyproject_buildrequires.py", line 721, in main
    generate_requires(
    ~~~~~~~~~~~~~~~~~^
        include_runtime=args.runtime,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<11 lines>...
        config_settings=parse_config_settings_args(args.config_settings),
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/lib/rpm/redhat/pyproject_buildrequires.py", line 602, in generate_requires
    backend = get_backend(requirements)
  File "/usr/lib/rpm/redhat/pyproject_buildrequires.py", line 263, in get_backend
    raise FileNotFoundError('File "setup.py" not found for legacy project.')
FileNotFoundError: File "setup.py" not found for legacy project.

Expected behavior

Fedora's build system is able to build borgmatic using pyproject.toml alone.

Other notes / implementation ideas

No response

borgmatic version

1.9.1

borgmatic installation method

No response

Borg version

No response

Python version

3.13.0

Database version (if applicable)

No response

Operating system and version

Fedora Linux 41 (Workstation Edition)

### What I'm trying to do and why `pyproject.yaml` is missing the `build-backend` key. [It's there, but commented out](https://projects.torsion.org/borgmatic-collective/borgmatic/src/commit/22776b123d5b6192aff26d1bb1cd23d2b945d1ff/pyproject.toml#L41). Fedora's buildsystem, in adherence with PEP 517, will then try to execute the non-existent `setup.py`. Relevant PEP 517 quote: > 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). ### Steps to reproduce Downloading the [latest borgmatic RPM spec file](https://src.fedoraproject.org/rpms/borgmatic/blob/rawhide/f/borgmatic.spec) and try building it locally or in mock. ### Actual behavior Snippet from Fedora buildsystem: ``` + /usr/bin/python3 -Bs /usr/lib/rpm/redhat/pyproject_buildrequires.py --generate-extras --python3_pkgversion 3 --wheeldir /builddir/build/BUILD/borgmatic-1.9.1-build/pyproject-wheeldir --output /builddir/build/BUILD/borgmatic-1.9.1-build/borgmatic-1.9.1-2.fc42.x86_64-pyproject-buildrequires Handling setuptools>=61.0 from build-system.requires Requirement not satisfied: setuptools>=61.0 Traceback (most recent call last): File "/usr/lib/rpm/redhat/pyproject_buildrequires.py", line 721, in main generate_requires( ~~~~~~~~~~~~~~~~~^ include_runtime=args.runtime, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...<11 lines>... config_settings=parse_config_settings_args(args.config_settings), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ) ^ File "/usr/lib/rpm/redhat/pyproject_buildrequires.py", line 602, in generate_requires backend = get_backend(requirements) File "/usr/lib/rpm/redhat/pyproject_buildrequires.py", line 263, in get_backend raise FileNotFoundError('File "setup.py" not found for legacy project.') FileNotFoundError: File "setup.py" not found for legacy project. ``` ### Expected behavior Fedora's build system is able to build borgmatic using `pyproject.toml` alone. ### Other notes / implementation ideas _No response_ ### borgmatic version 1.9.1 ### borgmatic installation method _No response_ ### Borg version _No response_ ### Python version 3.13.0 ### Database version (if applicable) _No response_ ### Operating system and version Fedora Linux 41 (Workstation Edition)
Owner

Thanks for filing this. This is fixed in main and will be part of the next release!

Thanks for filing this. This is fixed in main and will be part of the next release!
Owner

Released in borgmatic 1.9.2!

Released in borgmatic 1.9.2!
Sign in to join this conversation.
No Milestone
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: borgmatic-collective/borgmatic#932
No description provided.