Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: beautify the build error #1501

Merged
merged 1 commit into from
Nov 8, 2022
Merged

feat: beautify the build error #1501

merged 1 commit into from
Nov 8, 2022

Conversation

frostming
Copy link
Collaborator

@frostming frostming commented Nov 8, 2022

Pull Request Check List

  • A news fragment is added in news/ describing what is new.
  • Test cases added for changed code.

Describe what you have changed in this PR.

Fix #1491

@frostming
Copy link
Collaborator Author

Module missing:

[BuildError]: Build backend raised error: Module 'requests' is missing, please make sure it is specified in the
'build-system.requires' section. If it is not possible, add it to the project and use '--no-isolation' option.
Showing the last 10 lines of the build output:
  File "C:\Workspace\GitHub\pdm\venv\lib\site-packages\pep517\in_process\_in_process.py", line 297, in
get_requires_for_build_sdist
    return hook(config_settings)
  File "C:\Users\frost\AppData\Local\Temp\pdm-build-env-cvewzv4m-shared\Lib\site-packages\setuptools\build_meta.py",
line 341, in get_requires_for_build_sdist
  File "C:\Users\frost\AppData\Local\Temp\pdm-build-env-cvewzv4m-shared\Lib\site-packages\setuptools\build_meta.py",
line 320, in _get_build_requires
    self.run_setup()
  File "C:\Users\frost\AppData\Local\Temp\pdm-build-env-cvewzv4m-shared\Lib\site-packages\setuptools\build_meta.py",
line 335, in run_setup
    exec(code, locals())
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'requests'

Misconfiguration:

[BuildError]: Build backend raised error: Showing the last 10 lines of the build output:

on purpose, you should not rely on automatic discovery.
Instead, consider the following options:

1. set up custom discovery (`find` directive with `include` or `exclude`)
2. use a `src-layout`
3. explicitly set `py_modules` or `packages` with a list of names
To find more information, look for "package discovery" on setuptools docs.
Add '-v' to see the detailed traceback

pyproject.toml invalid:

See C:\Users\frost\AppData\Local\Temp\pdm-build-3nx8gx3e.log for detailed debug log.
[BuildError]: Build backend raised error: Showing the last 10 lines of the build output:
  File "C:\Users\frost\AppData\Local\Temp\pdm-build-env-tjfmq0te-shared\Lib\site-packages\setuptools\dist.py", line 868,
in parse_config_files
    pyprojecttoml.apply_configuration(self, filename, ignore_option_errors)
  File
"C:\Users\frost\AppData\Local\Temp\pdm-build-env-tjfmq0te-shared\Lib\site-packages\setuptools\config\pyprojecttoml.py",
line 62, in apply_configuration
    config = read_configuration(filepath, True, ignore_option_errors, dist)
  File
"C:\Users\frost\AppData\Local\Temp\pdm-build-env-tjfmq0te-shared\Lib\site-packages\setuptools\config\pyprojecttoml.py",
line 126, in read_configuration
    validate(subset, filepath)
  File
"C:\Users\frost\AppData\Local\Temp\pdm-build-env-tjfmq0te-shared\Lib\site-packages\setuptools\config\pyprojecttoml.py",
line 51, in validate
    raise ValueError(f"{error}\n{summary}") from None
ValueError: invalid pyproject.toml config: `project`.
configuration error: `project` must not contain {'license1'} properties
Add '-v' to see the detailed traceback

@frostming frostming merged commit 669096c into main Nov 8, 2022
@frostming frostming deleted the beautiful-build-error branch November 8, 2022 08:48
@pawamoy
Copy link
Contributor

pawamoy commented Nov 8, 2022

That's great, thanks @frostming!

@j178 j178 mentioned this pull request Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error from pyproject validation are unclear.
2 participants