jazzband / pip-tools

A set of tools to keep your pinned Python dependencies fresh.
https://pip-tools.rtfd.io
BSD 3-Clause "New" or "Revised" License
7.69k stars 610 forks source link

Display `pyproject.toml`'s metatada parsing errors in verbose mode #1979

Closed szobov closed 1 year ago

szobov commented 1 year ago

Fixes #1711.

Before the changes implemented in this PR, the execution of pip-compile was silent about an error in pyproject.toml file. If the user made a mistake in the configuration file, the output of the command was:

Backend subprocess exited when trying to invoke prepare_metadata_for_build_wheel

Now, the output is the following (the error is in the "licence" field for demonstration):

<truncated traceback>
ValueError: invalid pyproject.toml config: `project.license`.
configuration error: `project.license` must be valid exactly by one definition (2 matches found):

    - keys:
        'file': {type: string}
      required: ['file']
    - keys:
        'text': {type: string}
      required: ['text']

Backend subprocess exited when trying to invoke get_requires_for_build_wheel

There are several issues already mentioned on GitHub: https://github.com/jazzband/pip-tools/issues/1711 https://github.com/jazzband/pip-tools/issues/1794

The changes implemented in this PR are possible only because of the new build version release: https://github.com/pypa/build/issues/615#issuecomment-1703239433 The particular change is this: https://github.com/pypa/build/pull/566.

Please pay attention that in case of an error, the traceback is huge, but unfortunately, the error is captured and printed inside build.ProjectBuilder, and it's currently impossible to capture it and show only a short error description. On the other hand, the traceback gives the user an extra debug information.

Contributor checklist
Maintainer checklist
szobov commented 1 year ago

I'm wondering how I can restart ci checks since they're failed due to a timeout error (most likely a network hiccup)

atugushev commented 1 year ago

I've restarted failed jobs.

szobov commented 1 year ago

Thanks, @atugushev, for your help and patience! I think PR can now be merged since the only failing job is docs build, which you'll probably fix soon by merging https://github.com/jazzband/pip-tools/pull/1983 But now it's your turn to take an action! :)

szobov commented 1 year ago

rebased on the fresh main branch