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

Fix pyproject.toml #237

Merged
merged 1 commit into from
Jan 30, 2025
Merged

Fix pyproject.toml #237

merged 1 commit into from
Jan 30, 2025

Conversation

alexandrelarouche
Copy link
Contributor

@alexandrelarouche alexandrelarouche commented Jan 30, 2025

Context: I tried building from source with poetry, but kept getting the following error:

× Preparing editable metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [17 lines of output]
      Traceback (most recent call last):
        File "/Users/quoding/.pyenv/versions/3.12.2/envs/tests/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 389, in <module>
          main()
        File "/Users/quoding/.pyenv/versions/3.12.2/envs/tests/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 373, in main
          json_out["return_val"] = hook(**hook_input["kwargs"])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/Users/quoding/.pyenv/versions/3.12.2/envs/tests/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 209, in prepare_metadata_for_build_editable
          return hook(metadata_directory, config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/b0/v5gv_vhn7jn281h_3m7rfj1c0000gn/T/pip-build-env-gd5ccoqe/overlay/lib/python3.12/site-packages/poetry/core/masonry/api.py", line 42, in prepare_metadata_for_build_wheel
          poetry = Factory().create_poetry(Path().resolve(), with_groups=False)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/b0/v5gv_vhn7jn281h_3m7rfj1c0000gn/T/pip-build-env-gd5ccoqe/overlay/lib/python3.12/site-packages/poetry/core/factory.py", line 59, in create_poetry
          raise RuntimeError("The Poetry configuration is invalid:\n" + message)
      RuntimeError: The Poetry configuration is invalid:
        - project must contain ['name'] properties
      
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

Turns out, the pyproject.toml was missing a block and a key.

This commit does the following:

  • Add [project] block with name, following poetry's documentation. This is necessary to build because projects.urls, is used. Otherwise, an error is thrown.
  • Fix Salem's name as author

- Add `[project]` block with `name`, following [poetry's documentation](https://python-poetry.org/docs/pyproject/). This is necessary to build because `projects.urls`, is used. Otherwise, an error is thrown.
- Fix Salem's name as author
Copy link
Collaborator

@saleml saleml left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot!

And thank you for fixing my name :)

@saleml saleml merged commit a59b581 into GFNOrg:master Jan 30, 2025
4 checks passed
@alexandrelarouche alexandrelarouche deleted the fix_toml branch January 30, 2025 14:02
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.

2 participants